Showing current directory in Terminal's title, using tcsh

Solution 1:

This is what I have in my .cshrc

alias cwdcmd 'printf "\033]1;%s\007\033]2;%s\007" "$cwd:t" "$HOST echo $cwd | sed s-$HOME-~-" '

It does some additional stuff for iTerm, which I use instead of Termial, but seems to work fine there as well.

Solution 2:

This is the prompt I use in tcsh. It sets the window title to the full path (which as Chris Page answered, gains extra functionality in Lion). The prompt itself is essentially [$HOST:$PWD] $USER% using tcsh % syntax.

set prompt = '%{\e]2;%~\a%}%S[%m:%c3] %n%#%s '