When splitting vertically with current profile by using the keyboard shortcut, Command + D, is it possible for the new iTerm window to have the same current working directory as the current one?

By default, invoking this command opens the new window with the users home directory as the current directory.

  • I'm voting to close this question as off-topic because it's not about Apple hardware or software as defined in the Help Center <apple.stackexchange.com/help/on-topic> – Mark Sep 24 at 16:26
  • @Mark Questions about applications running on macOS fall under the "third-party hardware, services and software when associated for use with Apple products." terms mentioned on the page you tried to link, so this is clearly on-topic. If you want to discuss the scope of this please raise a question on Meta. – nohillside Sep 24 at 16:55
up vote 8 down vote accepted

Open iTerm2 preferences by using the keyboard shortcut, Command + , or by invoking the command iTerm2 → Preferences... in the Menu Bar.

In the preferences window, switch to Profiles tab and under Working Directory select Advanced Configuration. (The default selection is Home directory.)

enter image description here

Now, click on the Edit... button, and in the pane that opens, under Working Directory for New Split Panes select Reuse previous session's directory. (The default selection is Home directory.)

enter image description here

Now, when invoking the Splitting Vertically with Current Profile command by pressing Command + D keys, the adjoining window will be opened with the same directory as the current working directory.

  • Is it possible at the same time to open home dir on Command + T ? – mrgloom Sep 25 at 8:59

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.