Mario Parra
Mario Parra

Reputation: 1554

Reusing previous session's working directory

I use iTerm on two Macs with my preferences synced via Dropbox and I'm trying to configure the default working directory.

Since I keep my projects in different locations on both Macs, I can't use a static working directory, so I set it to use the previous session's working directory, on quitting the app and restarting, it only ever defaults to the home directory. Is there an issue or am I misunderstanding the setting? Thanks.

Upvotes: 0

Views: 1995

Answers (3)

muya_
muya_

Reputation: 1008

Was facing a similar issue after a fresh install, where Split Panes were not picking up the original session's directory, despite having changed the setting.

Turns out a restart of iTerm is needed after changing the setting on your profile.

Reference: https://coderwall.com/p/9xo7aq/open-up-iterm2-splits-in-current-working-directory

Upvotes: 0

jeffery.yuan
jeffery.yuan

Reputation: 1255

See https://gitlab.com/gnachman/iterm2/issues/4162 Just Turn on Prefs > General > Save copy/paste and command history

Upvotes: 0

sel-fish
sel-fish

Reputation: 4476

iTerm2 don't store the working directory of session persistently, even it does, your can't use it as you shared the preferences.
If you choose Reusing previous session's working directory, it means that when you open new windows or new tabs or new split panes while iTerm2 is running, it will reuse. But it can't reuse when you restart it.
Maybe you should unify your locations by creating an alias or something like that to deal with your problem.

Upvotes: 4

Related Questions