If you use iTerm and frequently split your terminal into multiple panes, you might have noticed that new panes don’t always start in the same working directory as the original one. This can be inconvenient when navigating projects or working in deeply nested directories.

Luckily, iTerm has a built-in option to fix this!

To ensure that new panes inherit the working directory of the current terminal:

  1. Open iTerm.
  2. Go to Preferences (Cmd + ,).
  3. Navigate to the Profiles tab.
  4. Select your active profile (e.g., "Default").
  5. Under the General tab, check "Reuse previous session's directory".

That’s it! Now, when you split a pane using:

  • Cmd + Shift + D (Split Horizontally)
  • Cmd + D (Split Vertically)

the new terminal will start in the same directory as the previous one.