49

I'm using iTerm for my command line needs, and when I open a tab using ⌘T I want it to open the tab cd'ed to the same location as the tab that was open when I hit ⌘T (instead of opening in my /Users/kramer65).

I searched around the Preferences, but I can't seem to find it. Does anybody know how I can do this? All tips are welcome!

69

Select "Reuse previous session's directory" from the preferences of your profile:

Alternatively click on "Advanced Configuration" then "Edit..." so you can set the working directory separately for new windows, new tabs & new split panes

32

This is a year old, but I'd like to add a response that isn't so heavy-handed. The accepted answer will open the previous directory every time you open a new tab, which I personally find frustrating. I feel it's easier to always open in the home directory and then open the current directory in a new tab as needed.

To do that, simply run the following command:

open . -a iterm

That will open the current directory (open .) using the application (-a) that most closely matches iterm.

  • or just use command $ tab? – Kyslik May 8 '16 at 11:30
  • 2
    $ tab no such command @Kyslik – oluckyman Jan 21 at 19:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .