This is a follow-up to cft's earlier tip which showed how to put the current working directory in a terminal window's title. Another nice possibility is to display instead the current job. For instance, right now I have six terminal windows with these titles (quite a bit more informative than ttyp1 thru ttyp6...):
sched +0:00 alias postcmd 'echo -n "^[]0;\!#^G"'
As in the earlier tip, ^[ and ^G here are not to be typed literally. They are the ESC and BEL escape sequences, obtained in vi by typing ctrl-V ctrl-[ for the first one and ctrl-V ctrl-G for the second. Finally, save and close the file (esc :wq! return), open a new terminal window, and marvel.
sched +0:00 alias postcmd 'echo -n "^[]0; `hostname|cut -d.[space]
-f1`: `echo \\!# | cut -b 1-25`^G"'Please note it is shown on two lines, but is really one long line. Replace [space] with an actual space character and enter as one line of text.
sched +0:00 alias postcmd 'printf "\033]0; %s \007" "\!#:q"'
I have tested this new version, and it works just fine in tcsh...
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020207093427440