Open iTerm Tab with a Directory in Current Session I am working in

Like this?

iTerm Tab with cd.kmmacros (2.3 KB)


Note for other users who don’t want to read the whole thread:

If you are experiencing problems with the script, for example, a new iTerm window doesn’t come to the foreground:

  1. Open iTerm Preferences > Keys
  2. Make sure “Hotkey window hides when focus is lost” is unchecked – regardless of whether “Show/hide iTerm2 with a system-wide hotkey” is enabled!
  3. Relaunch iTerm.

If you want to leave the “Hotkey window hides…” enabled, you’ll have to modify the script. See posts below.


Update (2016-10-19 19:34 Z):

Better script:

It checks now if there is an open window. If yes, it opens a new tab, if not, it opens a window and writes to the window (without creating a new tab).

1 Like