20

I'm switching from Terminal.app

Pretty straightforward, but I can't find it in the settings: I'd like that when I open a new tab (with cmd-t (or btw also with oh-my-zsh's osx plugin's tab command)), the new tab uses the same profile than the current one (colors, fonts, whatnot).

Thanks!

11

Shell then New Tab With Current Profile (---T) does what it says on the tin.

  • 2
    This is great, but it's too bad there isn't a preference to make this the default (and have the special combo be for "open default profile") – agnoster Mar 13 '14 at 16:55
  • 8
    You can bind any keystroke to any menu item with the "Select Menu Item..." action (it's the last one). – George Jul 10 '15 at 22:43
31

I found some solution - although it should be simple global option.

You can go to keys definitions for each profile and there add mapping CMD+T > "open new tab with profile" and choose the same profile.

  • You can actually make this a global key preference, not just for each profile (don't have to set up each profile by itself, I mean) – Dannid Oct 9 '15 at 18:12
  • 2
    For ITerm2 it is located in Keys > + > Action: Select menu item > New tab with current profiel – Roman Bekkiev May 12 '17 at 10:25
  • its called "New Tab with profile" hence why I missed it looking for new tab verbiage. – Ray Foss Jun 30 '17 at 15:14
5

If you want this to happen as a default (the next terminal tab keep your directory):

  1. Open iTerm2
  2. Open Preferences
  3. Open Profiles
  4. Open General
  5. Under working directory choose Reuse previous session's directory

Happy Trails!

  • 1
    This is a completely unrelated item to opening with the same profile. It's a nice tip, but it doesn't address the OP's request. What this does do is open the new window/tab in the same path as the one it's coming from. Note that the profile you're opening into has to have this checked - the one you're coming from doesn't care. If you do, you'll get a new tab/window with whatever profile you're set to get (default if CMD+T or same profile if you use SHIFT+CMD+T or remapped CMD+T to do the same thing), plus the same working directory as your last window. – Dannid Oct 9 '15 at 18:17
  • 1
    You did not answer the question of the thread, but you answered the question I had when I found this thread. Thanks! – SeF Dec 5 '16 at 17:22
1

You can do this globally using System Preferences > Keyboard > Shortcuts

Select "App Shortcuts" in the sidebar and then add a new one. Select "iTerm2.app" in the Application dropdown, and then in the Menu Title section, type (exactly): New Tab with Current Profile

Then just press the shortcut you want in the "Keyboard Shortcut" section (I used ⌘T) and it will override the current shortcut of ⌥⇧⌘T.

1

For anyone still looking, I found a better solution for my use case. Similar to what Eric Hanko suggested, you can create a shortcut specifically for "Duplicate Tab" in Iterm2 that is much more direct, and replicates the "duplicate tab" functionality that I was used to coming from Terminal.

  1. Navigate to Systems Preferences > Keyboard > Shortcuts.
  2. Select "App Shortcuts" in the sidebar.
  3. Select "Iterm.app" from the Application dropdown.
  4. Type an exact match for the menu item to shortcut, in this case Duplicate Tab as of the time of writing.
  5. Add the shortcut. I used CMD + D.

NOTE: any shortcuts you create in System Preferences will override shortcuts already defined in Iterm2. This could lead to confusion later if you forget where your shortcuts are defined and get unexpected results using shortcuts in Iterm2.

Again, thanks to Eric Hanko for paving the way here.

0

Assign a shortcut to the profile, then you can open a new tab with the profile.

Example

0

In iterm2, you can also map Cmd+T to the "New Tab with profile" action

  1. Open Preferences > Profiles > Keys,
  2. Select a profile
  3. Add a new shortcut key for "New Tab with profile" action, set profile to match the currently selected profile, and set the shortcut to Cmd+T

You'll have to repeat this for each profile that you want to configure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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