Tuesday, June 13, 2006

Title Your PuTTY's

Every day I end up with at least a half-dozen PuTTY sessions open to various unix and other POSIX-ish boxes. By default PuTTY titles each window with the hostname, but when I have multiple sessions to a single box, it's hard to keep them straight. I was happy to see that PuTTY handles the same title escape sequence as xterm, so you can programmatically change the window title from the host you're connected to.

Just set up an alias, function, shell script, .profile, or even your $PROMPT to echo the right sequence and you'll be able to title your windows, whether they're PuTTY sessions, xterms, Gnome terminals, or almost any other Linux terminal session package.

The sequence is: <esc>]0;<title><bel> where <esc> is the escape key, 0 is a zero, <bel> is control-G and <title> is the title you want to set.



Technocrati tags:

No comments: