Disable starting an initial xterm when X11 is started


Issue: The implementation of X11 in Leopard+ is not intended to be started from the Applications → Utilities folder (as it was in Tiger). Instead, X11 is automatically started on demand when an X application is started. X11 can still be started by itself by double-clicking on the X11 icon in the Applications → Utilities folder, but this will also automatically start an xterm window. Under Leopard+, there is no system xinitrc file that can be edited to disable starting that initial xterm. Please make it stop!


Solution: It's not entirely true that there is no longer a system-wide xinitrc file; it has just moved to

/usr/X11/lib/X11/xinit/xinitrc

Alternatively, issue the following command in a Terminal or xterm (X11) window:

defaults write org.x.X11 app_to_run /usr/bin/true

The true routine (intentionally) does nothing (no, really, just type man true and see for yourself). Repeat with /usr/bin/true replaced by xterm to restore the default behavior. The file modified by defaults in this case is ~/Library/Preferences/org.x.X11.plist.

Note: because of the new way that OS X v10.5+ handles X11 compared to Tiger, you should also not configure X11 to start automatically at login, nor include it as a launcher in the Dock. Starting X11 in either of these ways will result in multiple copies of X11 running. You should also not start X11 manually if it has already been automatically launched by Leopard.

OS Version Compatibility: Lion, Snow Leopard, Leopard

Update Status: 03 December 2009