OSX Leopard: Keep XTerm from starting with X11

As we established before, X11 on OSX 10.5 Leopard is, at least kind-of, broken.

Gladly, there are numerous community efforts to bring our tragic hero back on stage. For example, like in OSX 10.4 Tiger, it is possible to deactivate the XTerm window starting up every time you start X11. It has just become a little more complicated.

First, this is what has changed with launching X11 on Leopard (as described on boredzo.org):

In Tiger, when you launch X11, it runs .xinitrc, and .xinitrc runs xterm (unless you comment that line out).

In Leopard, X11.app is just a launcher. All it does is run /usr/bin/login -pf $USER /usr/X11/bin/xterm. In other words, its only purpose is to run xterm (semi-)directly, by itself–it’s not the actual X11 server anymore. When xterm starts, launchd sees it, notices that xterm requires X11, and launches the real X11 server (/usr/X11/X11.app) automatically.

In other words, there’s no commenting out a line in .xinitrc anymore in Leopard. Instead, we need to change the launcher itself (as described in the very useful X11 on Leopard FAQ on macosxhints):

defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xlsclients

Instead of xlsclients, we can alternatively run xprop (thanks, JP!). Both applications have the good habit not to do much (i.e. not to waste a lot of cycles/energy/water/CO2/whatever) and also not to open an annoying window like xterm does.

Hope this helps :)



Categories: Mozilla Crosspost, Tech Talk | Tags: , , ,

6 Responses to “OSX Leopard: Keep XTerm from starting with X11”

  1. I thought the point was that you don’t need to launch X11 itself anymore, just launch any program that needs it and launchd wil take care of starting it, assuming it’s not started already, so the right way is to take X11 out of the dock and replace it with a program that actually needs it (or simply launch them from the terminal without starting X11 first)

    see point 5 in the FAQ you point to for more.

  2. Doesn’t this mean that you should never have to launch X11 manually (assuming that launchd recognises all your X11 apps)?

  3. Yes, this is correct. For example, when I figure up the Gimp (my most-used X11 program), before this change, OSX would start X11 automatically, but it’d also open an xterm window that I had to close by hand then.

  4. @dave: Yes, it does start on its own. I am not starting X11 by hand (and never have). But while starting automatically, X11 *also* fires up an instance of XTerm along with the program you would actually like to use, which gets nothing short of annoying after a while…

  5. Any idea why opening a new terminal window would launch x11? It happens every time and is quite frustrating… but I can’t seem to find anything about this on the net! I’m going insane!! Help!

  6. Ah, I solved it. Just had to comment out the line “test -r /sw/bin/init.sh && . /sw/bin/init.sh” in my .profile file… meh

Leave a Reply