When I start the X11.app then it launches an xterm automatically. I've long since switched from the "ordinary" xterm to rxvt-unicode so the initial xterm just hangs around like a wallflower never being used. Whilst it's not particularly bad, it spoils the look of the place so I'd like to stop it launching. How do I do it?

3 Answers 3

defaults write org.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.

  • Uh, sorry, I hadn't noticed that you use X11.app. Don't do that. Use XQuartz for all your X11 needs on the mac. That said, I think X11.app has the same defaults setting, but I don't remember the name of the preferences file. Look for it in Library/Preferences/. Jun 14, 2012 at 18:44
  • Last time I used Mac OS X then XQuartz wasn't around so I hadn't heard of that - any other things like that I should know about? For X11 it's org.x.X11, and I set the value to '' which seemed to work as well as /usr/bin/true. Jun 14, 2012 at 18:48
  • Hmm. No, I can't think of anything other than X11/XQuartz with that particular peculiarity. Though I remain forever confused about whether I should get my Java updates from Apple or Oracle these days. Jun 14, 2012 at 18:52
  • if you use fink, packages are not built for Xquartz on 10.6. so your suggestion is invalid, harald.
    – Wyatt Ward
    Apr 25, 2015 at 21:03
  • @Wyatt8740 I'll take your word for it. I don't have any suggestions for what to do in that case. If you do find out, feel free to add your own answer or comment. (Or if you need the answer but don't know how, ask a new question.) Apr 26, 2015 at 13:37

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)

  • Yes, the '' worked for me on Big Sur with zsh shell instead of true (as true is builtin for zsh).
    – Christian
    Jan 29, 2021 at 15:33
  • @Christian Oh, did Big Sur replace bash/bourne shell with zsh and remove /bin/true? I had no idea (my mac won't run Big Sur).
    – Wyatt Ward
    Jul 25, 2021 at 19:23

It appears that starting with XQuartz 2.8 you would do:

defaults write org.xquartz.X11 app_to_run APP
  • 1
    This would be better as an edit to the other answers apple.stackexchange.com/a/183267/237 looks the most complete
    – mmmmmm
    May 28, 2021 at 19:25
  • This worked on Xquartz 2.8.1, Mac OS Catalina (accepted answer didn't).
    – Niloct
    Aug 5, 2021 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .