Re: Quartz no longer launching when an X application is invoked
> On Dec 4, 2023, at 10:08, Ryan Schmidt wrote: > > Could you file a new ticket to do that cleanup? Bonus points if you want to > submit a pull request to implement it. See: > Thanks for providing the history here. Ticket 68836 created. https://trac.macports.org/ticket/68836#ticket
Re: Quartz no longer launching when an X application is invoked
On Dec 3, 2023, at 18:28, Kevin Horton wrote: > > I find in ~/.zprofile > > # MacPorts Installer addition on 2020-12-29_at_06:08:54: adding an > appropriate DISPLAY variable for use with MacPorts. > export DISPLAY=:0 > # Finished adapting your DISPLAY environment variable for use with MacPorts. > > My other machine also has a ~/.zprofile, but it only sets the PATH. it does > not set DISPLAY. > > I surmise that MacPorts stopped fiddling with DISPLAY sometime between late > 2020 and late 2021. Maybe there should be some automatic check of DISPLAY in > .zprofile, and a it could offer to clean it up if needed. The MacPorts 2.6.4 installer for macOS 11 inadvertently added the DISPLAY=:0 setting to shell startup files. The bug was corrected in MacPorts 2.7.0 but no code was ever added to clean up the mess for users who had already used the 2.6.4 installer. https://trac.macports.org/ticket/61649 Could you file a new ticket to do that cleanup? Bonus points if you want to submit a pull request to implement it. See: https://github.com/macports/macports-base/pull/218#issuecomment-739666236
Re: Quartz no longer launching when an X application is invoked
Chris Jones writes: > Users should not need to do *anything* to get DISPLAY correctly set. > Anything you have in your personal environment configuration should be > removed. If you aren't getting DISPLAY set with the correct launchd > socket by default then you must have something that is interfering with > this. I removed that line and rebooted, and lo and behold, DISPLAY got properly set and the X server started up automatically when I launced an X11 program. Thanks for reminding us, Chris. > > On 04/12/2023 2:15 pm, Pieter van Oostrum wrote: >> On my machine I have: >> export DISPLAY=$(launchctl getenv DISPLAY) >> I don't know if that is the canonical way to do it but for me it works. > -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4]
Re: Quartz no longer launching when an X application is invoked
Users should not need to do *anything* to get DISPLAY correctly set. Anything you have in your personal environment configuration should be removed. If you aren't getting DISPLAY set with the correct launchd socket by default then you must have something that is interfering with this. On 04/12/2023 2:15 pm, Pieter van Oostrum wrote: On my machine I have: export DISPLAY=$(launchctl getenv DISPLAY) I don't know if that is the canonical way to do it but for me it works.
Re: Quartz no longer launching when an X application is invoked
On my machine I have: export DISPLAY=$(launchctl getenv DISPLAY) I don't know if that is the canonical way to do it but for me it works. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4]
Re: Quartz no longer launching when an X application is invoked
One of my machines has: % echo $DISPLAY :0 Digging deeper, I find in ~/.zprofile # MacPorts Installer addition on 2020-12-29_at_06:08:54: adding an appropriate DISPLAY variable for use with MacPorts. export DISPLAY=:0 # Finished adapting your DISPLAY environment variable for use with MacPorts. My other machine also has a ~/.zprofile, but it only sets the PATH. it does not set DISPLAY. I surmise that MacPorts stopped fiddling with DISPLAY sometime between late 2020 and late 2021. Maybe there should be some automatic check of DISPLAY in .zprofile, and a it could offer to clean it up if needed. Cheers, Kevin > On Dec 1, 2023, at 03:42, Christopher Jones wrote: > > > >> On 1 Dec 2023, at 6:52 am, Kenneth Wolcott wrote: >> >> Hi; >> >> So what is the proper way for X to be started? > > > If properly configured the X11 server will automatically start on demand. You > really should never need to manually start it. > >> >> Do I need to manually create a launch entry like I have for the >> emacs server? If so, what is the invocation? What is being invoked? >> xorg-server? >> >> Now that the DISPLAY is null, invoking xpdf fails even after an open >> -a /Applications/MacPorts/X11.app, complaining about the DISPLAY >> variable setting > > Having DISPLAY null is as bad as setting it to :0.0 > > It should look something like what I posted before > > $ echo $DISPLAY > /private/tmp/com.apple.launchd.TwDg8TRtvI/org.macosforge.xquartz:0 > > This is the launchd socket, the magic if you like, that triggers it to be > started on demand. > > Please try as I posted in my first mail completeing uninstalling org-server, > then re-install it. Then log out and back in again (this is important) and > then see. If it is still null then you have something else setting that and > you need to figure out what. > > Chris > >> >> Thanks, >> Ken >> >> On Thu, Nov 30, 2023 at 10:47 PM Kenneth Wolcott >> wrote: >>> >>> Hi Ryan; >>> >>> It was defined in ~/.zprofile and created by MacPorts in 2021 :-) I >>> commented it out. I'll source the .zprofile and see what happens. >>> >>> Thanks, >>> Ken >>> >>> On Thu, Nov 30, 2023 at 10:23 PM Ryan Schmidt >>> wrote: On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: > > 3. My DISPLAY environment variable is set to ":0"; > I do not know where this variable is not being set properly or is > being overridden. You need to figure out where DISPLAY=:0 is being set, and remove the code that does so. It's probably in your shell startup file. Depending on which shell you use, there are many possible names for startup files in your home directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not been correct since Mac OS X 10.5. >
Re: Quartz no longer launching when an X application is invoked
Thank you all for your efforts. I'm still not getting it. Thanks, Ken On Fri, Dec 1, 2023 at 1:43 AM Christopher Jones wrote: > > > > On 1 Dec 2023, at 6:52 am, Kenneth Wolcott wrote: > > Hi; > > So what is the proper way for X to be started? > > > > If properly configured the X11 server will automatically start on demand. You > really should never need to manually start it. > > > Do I need to manually create a launch entry like I have for the > emacs server? If so, what is the invocation? What is being invoked? > xorg-server? > > Now that the DISPLAY is null, invoking xpdf fails even after an open > -a /Applications/MacPorts/X11.app, complaining about the DISPLAY > variable setting > > > Having DISPLAY null is as bad as setting it to :0.0 > > It should look something like what I posted before > > $ echo $DISPLAY > /private/tmp/com.apple.launchd.TwDg8TRtvI/org.macosforge.xquartz:0 > > This is the launchd socket, the magic if you like, that triggers it to be > started on demand. > > Please try as I posted in my first mail completeing uninstalling org-server, > then re-install it. Then log out and back in again (this is important) and > then see. If it is still null then you have something else setting that and > you need to figure out what. > > Chris > > > Thanks, > Ken > > On Thu, Nov 30, 2023 at 10:47 PM Kenneth Wolcott > wrote: > > > Hi Ryan; > > It was defined in ~/.zprofile and created by MacPorts in 2021 :-) I > commented it out. I'll source the .zprofile and see what happens. > > Thanks, > Ken > > On Thu, Nov 30, 2023 at 10:23 PM Ryan Schmidt wrote: > > > On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: > > > 3. My DISPLAY environment variable is set to ":0"; > I do not know where this variable is not being set properly or is > being overridden. > > > You need to figure out where DISPLAY=:0 is being set, and remove the code > that does so. It's probably in your shell startup file. Depending on which > shell you use, there are many possible names for startup files in your home > directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. > > Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not > been correct since Mac OS X 10.5. > >
Re: Quartz no longer launching when an X application is invoked
> On 1 Dec 2023, at 6:52 am, Kenneth Wolcott wrote: > > Hi; > > So what is the proper way for X to be started? If properly configured the X11 server will automatically start on demand. You really should never need to manually start it. > > Do I need to manually create a launch entry like I have for the > emacs server? If so, what is the invocation? What is being invoked? > xorg-server? > > Now that the DISPLAY is null, invoking xpdf fails even after an open > -a /Applications/MacPorts/X11.app, complaining about the DISPLAY > variable setting Having DISPLAY null is as bad as setting it to :0.0 It should look something like what I posted before $ echo $DISPLAY /private/tmp/com.apple.launchd.TwDg8TRtvI/org.macosforge.xquartz:0 This is the launchd socket, the magic if you like, that triggers it to be started on demand. Please try as I posted in my first mail completeing uninstalling org-server, then re-install it. Then log out and back in again (this is important) and then see. If it is still null then you have something else setting that and you need to figure out what. Chris > > Thanks, > Ken > > On Thu, Nov 30, 2023 at 10:47 PM Kenneth Wolcott > wrote: >> >> Hi Ryan; >> >> It was defined in ~/.zprofile and created by MacPorts in 2021 :-) I >> commented it out. I'll source the .zprofile and see what happens. >> >> Thanks, >> Ken >> >> On Thu, Nov 30, 2023 at 10:23 PM Ryan Schmidt >> wrote: >>> >>> On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: 3. My DISPLAY environment variable is set to ":0"; I do not know where this variable is not being set properly or is being overridden. >>> >>> You need to figure out where DISPLAY=:0 is being set, and remove the code >>> that does so. It's probably in your shell startup file. Depending on which >>> shell you use, there are many possible names for startup files in your home >>> directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. >>> >>> Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not >>> been correct since Mac OS X 10.5.
Re: Quartz no longer launching when an X application is invoked
Hi; So what is the proper way for X to be started? Do I need to manually create a launch entry like I have for the emacs server? If so, what is the invocation? What is being invoked? xorg-server? Now that the DISPLAY is null, invoking xpdf fails even after an open -a /Applications/MacPorts/X11.app, complaining about the DISPLAY variable setting. Thanks, Ken On Thu, Nov 30, 2023 at 10:47 PM Kenneth Wolcott wrote: > > Hi Ryan; > > It was defined in ~/.zprofile and created by MacPorts in 2021 :-) I > commented it out. I'll source the .zprofile and see what happens. > > Thanks, > Ken > > On Thu, Nov 30, 2023 at 10:23 PM Ryan Schmidt wrote: > > > > On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: > > > > > > 3. My DISPLAY environment variable is set to ":0"; > > > I do not know where this variable is not being set properly or is > > > being overridden. > > > > You need to figure out where DISPLAY=:0 is being set, and remove the code > > that does so. It's probably in your shell startup file. Depending on which > > shell you use, there are many possible names for startup files in your home > > directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. > > > > Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not > > been correct since Mac OS X 10.5.
Re: Quartz no longer launching when an X application is invoked
Hi Ryan; It was defined in ~/.zprofile and created by MacPorts in 2021 :-) I commented it out. I'll source the .zprofile and see what happens. Thanks, Ken On Thu, Nov 30, 2023 at 10:23 PM Ryan Schmidt wrote: > > On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: > > > > 3. My DISPLAY environment variable is set to ":0"; > > I do not know where this variable is not being set properly or is > > being overridden. > > You need to figure out where DISPLAY=:0 is being set, and remove the code > that does so. It's probably in your shell startup file. Depending on which > shell you use, there are many possible names for startup files in your home > directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. > > Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not > been correct since Mac OS X 10.5.
Re: Quartz no longer launching when an X application is invoked
On Nov 30, 2023, at 16:01, Kenneth Wolcott wrote: > > 3. My DISPLAY environment variable is set to ":0"; > I do not know where this variable is not being set properly or is > being overridden. You need to figure out where DISPLAY=:0 is being set, and remove the code that does so. It's probably in your shell startup file. Depending on which shell you use, there are many possible names for startup files in your home directory: .zshrc, .zprofile, .bashrc, .bash_profile, etc. Setting DISPLAY=:0 was correct in Mac OS X 10.4 and earlier but it has not been correct since Mac OS X 10.5.
Re: Quartz no longer launching when an X application is invoked
Hi Chris; Thank you for your response. 1. I manually use /Applications/MacPorts/X11.app (/usr/bin/open -a /Applications/MacPorts/X11.app when inside a script) when invoking an app (such as /opt/local/bin/xtern) which then fails: ~: which xterm /opt/local/bin/xterm ~: xterm & [1] 6134 [1] + exit 1 xterm ~: xterm: Xt error: Can't open display: :0 ~: open -a /Applications/MacPorts/X11.app ~: xterm & [1] 6423 ~: echo $DISPLAY :0 2. I uninstalled and re-installed xorg-server per your instructions. This did not solve the problem. 3. My DISPLAY environment variable is set to ":0"; I do not know where this variable is not being set properly or is being overridden. I do have an emacs server launch: ~/Library/LaunchAgents/gnu.emacs.daemon.plist Should I create something similar for X? If so, what app needs to do the work? org-server? Thanks, Ken Wolcott On Thu, Nov 30, 2023 at 2:55 AM Chris Jones wrote: > > Hi, > > 'Quartz' has nothing to do with X11, its the primary compositor used by > macOS itself to render graphics. > > I assume you are actually taking about the X11 server, which in MacPorts > is provided by the 'xorg-server' port and historically was provided by > the 'XQuartz' package. > > Some basic questions. > > 1. What installation of the X11 server are you using ? the MacPorts > provided one or something else ? > > 2. Regardless of your answer to 1., try (re)installing the MacPorts > provided one > > > sudo port uninstall xorg-server > > sudo port install xorg-server > > Then log out and back in again. This step is important as if you skip it > things do not work correctly. > > 3. Finally, in order for the automatic starting of the X11 server on > demand to work, you need your DISPLAY variable set correctly. It should > look something like > > $ echo $DISPLAY > /private/tmp/com.apple.launchd.TwDg8TRtvI/org.macosforge.xquartz:0 > > i.e. it needs to refer to a launchd socket. If you see something else > instead you like are overriding this somewhere and you need to find and > remove this. > > Chris > > On 30/11/2023 5:30 am, Kenneth Wolcott wrote: > > Hi; > > > > Quartz no longer launching when an X application is invoked > > > > The first time I had installed some ports that were dependent on > > Quartz I had difficulty getting them to start because Quartz was not > > running. > > > > The first solution was to manually invoke Quartz, which worked ok. > > > > I then was able to get Quartz to start via Launch when an X > > application was invoked. > > > > Recently (?) it stopped working and I'm not sure why. > > > > All research I've done so far has been fruitless, I'm just not asking > > the right questions... > > > > I'm back to manually starting Quartz. > > > > Please show me how to diagnose the problem and also to solve it. > > > > Thanks, > > Ken Wolcott
Re: Quartz no longer launching when an X application is invoked
Hi, 'Quartz' has nothing to do with X11, its the primary compositor used by macOS itself to render graphics. I assume you are actually taking about the X11 server, which in MacPorts is provided by the 'xorg-server' port and historically was provided by the 'XQuartz' package. Some basic questions. 1. What installation of the X11 server are you using ? the MacPorts provided one or something else ? 2. Regardless of your answer to 1., try (re)installing the MacPorts provided one > sudo port uninstall xorg-server > sudo port install xorg-server Then log out and back in again. This step is important as if you skip it things do not work correctly. 3. Finally, in order for the automatic starting of the X11 server on demand to work, you need your DISPLAY variable set correctly. It should look something like $ echo $DISPLAY /private/tmp/com.apple.launchd.TwDg8TRtvI/org.macosforge.xquartz:0 i.e. it needs to refer to a launchd socket. If you see something else instead you like are overriding this somewhere and you need to find and remove this. Chris On 30/11/2023 5:30 am, Kenneth Wolcott wrote: Hi; Quartz no longer launching when an X application is invoked The first time I had installed some ports that were dependent on Quartz I had difficulty getting them to start because Quartz was not running. The first solution was to manually invoke Quartz, which worked ok. I then was able to get Quartz to start via Launch when an X application was invoked. Recently (?) it stopped working and I'm not sure why. All research I've done so far has been fruitless, I'm just not asking the right questions... I'm back to manually starting Quartz. Please show me how to diagnose the problem and also to solve it. Thanks, Ken Wolcott
Quartz no longer launching when an X application is invoked
Hi; Quartz no longer launching when an X application is invoked The first time I had installed some ports that were dependent on Quartz I had difficulty getting them to start because Quartz was not running. The first solution was to manually invoke Quartz, which worked ok. I then was able to get Quartz to start via Launch when an X application was invoked. Recently (?) it stopped working and I'm not sure why. All research I've done so far has been fruitless, I'm just not asking the right questions... I'm back to manually starting Quartz. Please show me how to diagnose the problem and also to solve it. Thanks, Ken Wolcott