Now that I figured out how to set iTerm2 as the ssh:// URL handler, I'd like iTerm2 to respond to an ssh URL by opening a new window instead of opening a new tab in an existing window. Is this possible?
MacOS – Open iTerm2 SSH session in new window instead of new tab
itermmacosssh
Related Question
- Change default ssh:// behavior
- Can a SSH session be wrapped to appear as a distinct App
- MacOS – Open an ssh session in terminal with BetterTouchTool
- MacOS – Keynote: How to skip “open presentation” window
- Read iTerm2 last session output history
- MacOS – Terminal opens new tab instead of new window with Command-N
- ITerm2 how to get autocomplete through tab key
- How to create a hotkey for opening a new iTerm2 window
Best Answer
I was curious about the same problem. After reviewing the source code, I found in iTerm2 v1.0.0.20111020 is hard-coded to open a new session as a tab if a session already exists, when it receives nearly any "launch this URL with a handler" command.
My Xcode and Objective-C skills are still rather weak, but if you want to give it a shot I believe the problem is related to the source file iTermController.m. On lines 789 to 870 the
launchBookmark:withURL
method has the following code:I suspect that when
theTerm == nil
,addNewSession
works as expected by launching a new window, since one is currently not running. Perhaps you can modify the code to force the first block to always run, regardless oftheTerm
's contents.I hope this helps!! .. It may be worth filing a bug report or contacting the author if you're still having problems.