How do I get the terminals in terminal.app to go to the right directory after restart with tcsh?
Add this to ~/.cshrc:

if ( "$TERM_PROGRAM" == Apple_Terminal ) then
    alias precmd 'printf "\033]7;file://"; hostname | tr -d "\n"; printf %s "$PWD" | xxd -p | sed -E "s|(..)|%\1|g;s|%2f|/|g"; printf "\a"'
endif


http://www.stairways.com/blog/2011-08-07-tcsh-remembering-path uses Perl, doesn't escape characters like % or ä, and doesn't ignore iTerm.