Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'to set titles in tcsh or csh' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
to set titles in tcsh or csh
Authored by: Apollo18Pnut on Oct 20, '03 01:30:06PM
This sets the title of any terminal window when you cd (or pushd or popd), instead of when the prompt is displayed, but it's basically the same idea. I have this in my ~/.cshrc file.
Note that "^[" is the ESC character, and "^G" is CTRL+G.

if ($?TERM) then
 switch ($TERM)
 case "Eterm*":
 case "xterm*":
  alias settitle 'echo -n "^[]2;$cwd^G"'
  settitle
  alias cd 'cd \!*;echo $cwd;settitle'
  alias pushd 'pushd \!*;settitle'
  alias popd 'popd \!*;settitle'
  alias wintitle 'echo ^[]0\;\!*^G'
  breaksw
 endsw
endif


[ Reply to This | # ]