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:
Add the following to your aliases.mine file to enable locking the title:
# -- setting the title bar --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.
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
•
[4,846 views]

