iTerm2 - open profile in a new window if different than current profile
0
votes
0
answers
142
views
I work extensively with tmux integration in iTerm2 and:
1. Open new profiles (typically connecting to a different tmux session) using shortcut keys
1. Open new windows or tabs within the same tmux session (same profile) using Cmd-w or Cmd-t
1. Use the hotkey window for most local terminal work
If I hit a shortcut key (for a tmux session profile) it always opens up in a tab of any already present iTerm2 window, which typically is the hotkey window, taking on the size of the hotkey window and not the window size defined in the profile. This becomes a "tmux session client" terminal which hides upon connection, but the whole tmux session than takes on the hotkey window's size as the default window size instead of the size from my profile.
One of the *Window* configuration options for an iTerm2 profile is *"Always open in a new window, never in a tab"*, but this even overrides using Cmd-t that would typically open in a Tab, so does not work.
**I am looking for:** a way to have the new profile (invoked with a shortcut key) to always open in a new Window, while having Cmd-t respected as a *new tab*.
One way I imagine doing this is having iTerm2 open a new profile in a new window only if the profile is different that the current window's profile.
I am open to any solution here.
Asked by Marcin K
(111 rep)
Jan 9, 2025, 01:00 AM
Last activity: Jan 10, 2025, 10:32 AM
Last activity: Jan 10, 2025, 10:32 AM