Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The keeps the tabs after a restart and it even shows the content of the buffers. But all open tabs are at the home directory rather than the working directory they were in at shutdown. I am using tcsh and I learned that this is the problem. It works for bash and Chris Page posted something for zsh, but I do not know how to adapt this to tcsh.

share|improve this question

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 uses Perl, doesn't escape characters like % or ä, and doesn't ignore iTerm.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.