- Create a script called chg_dir.sh (/Library/Scripts is a good place) with contents as follows:
#!/bin/sh
NOTE: ^[ represents the escape key, ^G represent control-G. To type these non-printing characters in vi, use ctrl-V and then "escape" and "control-G".
dir=$1
if [ ! ${dir} ] ; then
dir="$HOME"
fi
echo -n "^[]0;`uname -n`:${dir}^G"
- Edit your .cshrc (or equivilant) and add these two lines:
echo -n "^[]0;`uname -n`:${HOME}^G"
alias cd "cd !* ; /Library/Scripts/chg_dir.sh !*"
[Editor's note: There was another way to accomplish this same result posted in an earlier hint, but this one was unique enough to merit its own mention. I tested this, and it works as described. I added the two lines to my existing "aliases.mine" file, and placed the script in ~/bin. I still personally prefer this hint, which explains how to show the current command in the title bar, but the directory info is also useful.]

