Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The terminal.app 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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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.