Preventing X11.app from automatically opening an XTerm on launch

Mac OS X X11 Server, called X11.app, is configured to open a new xterm on launch by default. This default behavior can be pretty annoying, but can be easily disabled.

In order to stop Mac OS X X11.app from launching a new and empty xterm when launched for the first time, one must install a customized .xinitrc file into $HOME.

During start, X11.app looks for $HOME/.xinitrc and, if no one is found, it executes /etc/X11/xinit/xinitrc. It’s the /etc/X11/xinit/xinitrc script the one that launches an empty xterm.

To stop X11.app from launching an empty xterm:

  1. cp /etc/X11/xinit/xinitrc $HOME/.xinitrc
  2. Edit $HOME/.xinitrc and remove the line that reads "xterm &"

This will prevent X11.app from starting useless client applications, like xterm, on launch.

9 thoughts on “Preventing X11.app from automatically opening an XTerm on launch

  1. Thanks, this is about the only source of this information that I could Google. Can you publish it in forums.macosxhints.com so that other people can benefit from it?

  2. I’m having this problem. I found xinitrc only in X11/lib, not in /etc. The xinitrc I found did not contain a line starting xterm, rather it starts quartz-wm. Commenting out that line solved my problem. Apparently quartz-wm is a window manager for x.

    @Macintosh-2 ~ % locate xinitrc
    /sw/fink/10.3/unstable/main/finkinfo/x11/xinitrc.info
    /sw/fink/10.4-transitional/unstable/main/finkinfo/x11/xinitrc.info
    /sw/src/xfree86-base-4.2.1.1-3/xc/programs/xinit/xinitrc.cmd
    /sw/src/xfree86-base-4.2.1.1-3/xc/programs/xinit/xinitrc.cpp
    /usr/X11/lib/X11/xinit/xinitrc

    @Macintosh-2 ~ % cat .xinitrc
    #!/bin/sh

    userresources=$HOME/.Xresources
    usermodmap=$HOME/.Xmodmap
    sysresources=/usr/X11/lib/X11/xinit/.Xresources
    sysmodmap=/usr/X11/lib/X11/xinit/.Xmodmap

    # merge in defaults and keymaps

    if [ -f “$sysresources” ]; then
    xrdb -merge “$sysresources”
    fi

    if [ -f “$sysmodmap” ]; then
    xmodmap “$sysmodmap”
    fi

    if [ -f “$userresources” ]; then
    xrdb -merge “$userresources”
    fi

    if [ -f “$usermodmap” ]; then
    xmodmap “$usermodmap”
    fi

    exec quartz-wm

  3. Thanks for the Post, thanks for this great Post. I will come back later ! Great information about surprise locksmith : surprise locksmith

  4. An interesting discussion may be worth comment. I think that you need to write more on this kind of topic, it might not be a taboo subject but generally everyone is not enough to communicate on such topics. To the next. Cheers

  5. Excellent post. I was checking constantly this blog and I am impressed! Very useful info particularly the last part Smile I care for such info a lot. I was looking for this certain information for a very long time. Thank you and good luck.

  6. Hmm it looks like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new to the whole thing. Do you have any tips and hints for first-time blog writers? I’d really appreciate it.

  7. Our story is all about new beginnings! We met, both after big, life-altering breakups, and started fresh together by fortunate coincidence. And we’ve marked a lot of milestones in the process! He helped me believe in myself in new ways (it was with his support that I bought my first place!), helped me see some good things I was missing and reminded me of the importance of a great sense of humor! I think its fitting that we’re having a Christmas wedding on December 19, since to me, Christmas marks the return to light! Our colors are deep green and gold, and we’re using lots of candles and fresh greenery to symbolize life and light. I think the Rococo suite would fit beautifully with our theme! It has a rich, botanical quality, but with a bright cheerfulness to it that brings just the right touch of whimsy and elegance. It would be such an honor to send this to our guests!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s