Apple - How do I prevent X11 opening an xterm when it starts?

defaults write org.macosforge.xquartz.X11 app_to_run /usr/bin/true

in a Terminal. However, note that it normally shouldn't be necessary to ever start XQuartz.app (or X11.app; see the comments) manually. It will start automatically when you run an X11 client, and then it will not start its defaults startup application.


Since I'm not at my OSX computer right now, I'll give you the fail-proof answer for this. 'true' does nothing and exits successfully, so I set that to run at startup.

Apple's old X11:
defaults write org.x.X11 app_to_run $(which true)

and for XQuartz:
defaults write org.macosforge.xquartz.X11 app_to_run $(which true)

and for MacPorts X11.app:
defaults write org.macports.X11 app_to_run $(which true)

In case you are wondering, $(which true) will make a line read, for example,
defaults write org.x.X11 app_to_run /bin/true.
I write it as $(which true) because I am not at my mac and do not remember if it is in /bin/true or some other location.

I have additionally read that you can set these to '' (that's two single quotes, so nothing at all), and it will do the same thing. I have not tried it, though.

(Source: https://xquartz.macosforge.org/trac/wiki/X11-UsersFAQ)

(edited because I forgot the all important 'app_to_run' in my examples)

Tags:

X11