This is a follow up on a previous tip to set the terminal title bar to the current working directory. Sometimes, it's useful to lock the title to a description of what you are doing, i.e., something more abstract than the current running job.

Add the following to your aliases.mine file to enable locking the title:

# -- setting the title bar -- if ( ${TERM} != "dumb") then # note, ^[ and ^G are escape characters, # in vi, ctrl-v, then ctrl-[ or ctrl-G, respectively alias settitle 'echo -n "^[]2;"\!*"^G"' # to lock the title, we forget the cwdcmd, and we set # the title to whatever I typed after "locktitle" alias locktitle 'unalias cwdcmd; settitle \!*' # to unlock the title, we set the cwdcmd to # run settitle as neccesary alias unlocktitle "alias cwdcmd 'settitle ${HOST} ${cwd}'" # we start with the titlebar set to the current working dir unlocktitle # I like my mutt window to say "--- Email by Mutt ---", and # do other tricks, which I put in a seperate script alias mutt '${HOME}/scripts/callMutt.sh'endif

Now, whenever I want an abstract title, I type "locktitle THAT TASK I'M WORKING ON", for example "locktitle TESTING THAT SERVER". To get it back to current working directory (or whatever), I do "unlocktitle". Notice the allcaps. I do this way to keep from getting confused.

^[ and ^G are control characters! If you just do a copy and paste from the web page, these are no longer control characters, but 2 individual letters. If you edit the alias file with vi, you can get the ^[ with CRTL-v and CRTL-[. The ^G you will get with CTRL-v and CTRL-G.
To be honest, I ran into the same problem until I read the comments from the script.