Keep current working directory when opening a new tab in with Mac OS X Lion and tcsh

Mac OS X Lion has a lot of new features. Even the was improved.

When you open a new tab it automatically changes the working directory to the one of the old tab. But if you’re using tcsh this great new feature won’t work by default. You have to tell the current working directory using escape sequences. This is also stated in the preferences of but it does not say how to do it.

With a little research I found the solution in the Linux-mini How-To of Xterm. Put the following lines in your .tcshrc file and will always know your current working directory

switch ($TERM)
case "xterm*":
alias precmd 'printf "\033]0;$cwd\007"'

blog comments powered by Disqus