Upgrading to Snow Leopard

Annika Backstrom
in Technology, on 5 April 2010. It is tagged #Computers, #Bash, #Mac OS X, #shell, #snow leopard, and #Terminal.

I've just upgraded my MacBook Pro to Mac OS X 10.6 "Snow Leopard." A little behind the curve, but I had some application compatibility concerns that caused me to wait. Now I'm upgraded so I can try the iPad emulator on a few of our websites.

I have one thing of note to log, so of course I'll post it here.

Bash Escape Sequences

On opening iTerm for the first time, I was greeted with this:

Last login: Mon Apr  5 11:29:31 on ttys001\e]1;fsck

You can see a bit of gibberish after the date, but before my prompt. So, I guess my old escape sequences stopped working in Snow Leopard. I have a set of functions that set window titles using escape sequences. Changing \e and \a to their octal equivalents worked for me. So these lines in .bashrc:

function setlabel { echo -ne "\e]1;$1\a"; }
function settitle { echo -ne "\e]2;$1\a"; }

Became this:

function setlabel { echo -ne "\033]1;$1\007"; }
function settitle { echo -ne "\033]2;$1\007"; }