Monday, August 13, 2007

Changing the Default Terminal in

By default, Apple's implementation of X11 starts an xterm at launch. I wanted to change this to automatically start mrxvt instead. To do so you need to edit the file /etc/X11/xinit/xinitrc.

Open a terminal and then open the xinitrc file in your preferred editor, using sudo. E.g.:

$ cd /etc/X11/xinit
$ sudo vi xinitrc

You'll need to enter your password. Once the file is open look for the lines which read:

# start some nice programs

xterm &

Put a hash mark/pound sign in front of the second line above to comment it out. I've installed mrxvt using MacPorts, so to start it with a black background and green text, I entered the following line:

/opt/local/bin/mrxvt -bg black -fg green &

Then, save and quit. If you're using vi like me, you'll need to use save the file using the exclamation point to override the read-only setting on the file, e.g:

Now my preferred terminal emulator program starts when I fire up X11 on my MacBook Pro.

No comments: