4 ms·
Does it support `tmux -CC` ? Sorry for being that HN commenter but, if not, I'm bored with yet another terminal that just equates established features. iTerm'
by AceJohnny2 3y ago
Does it support `tmux -CC` ?
Sorry for being that HN commenter but, if not, I'm bored with yet another terminal that just equates established features.
iTerm's killer feature is `tmux -CC` support, so that tmux's sessions are integrated natively. I find it shocking that, years after tmux established this feature, iTerm remains the only terminal emulator to use it.
- riddley 3y agoI read the Control Mode section of the man page, but the utility didn't leap off the page. Would you share what's cool about this mode?
- shmichael 3y agothe iterm mode allows one to create, split, resize remote terminals as of they were native terminal windows, instead of all of them being contained within one terminal window and controlled using completely different keyboard-only shortcuts (via tmux)
- singwhenurdown 3y agodoes this make it faster? or is it used for the native feel
- drbaba 3y agoMainly the native feel. For example, you can use standard Cmd-based keybindings to control tabs and panes, and get smooth mouse scrolling in each pane.
- lanza 3y agosshing into a server only happens within one shell. Thus you can open tmux there and that's the only level of granularity you can have. iterm window->iterm tab->ssh->tmux windows->tmux panes With `tmux -CC` it lets you hoist that chain upwards and map the entire ssh session into an iterm window. iterm window (ssh session) -> iterm tabs (tmux windows) The biggest benefit for me is that you can then open another tmux session within the CC one and use tmux as normal iterm window (ssh session) -> iterm tabs (tmux windows) -> tmux2 windows -> tmux2 panes And then the normal feature of tmux is that it persists across ssh sessions. This also means that the entire iTerm2 window and all its tabs and splits are also maintained across sessions. I think my current layout on my main development machine that I remote into is over 3 months old. Another point of view is that it decouples the state of your tmux tabs/panes from your terminal emulator itself. e.g. if you use this locally instead you could then terminate the entire iterm program and reopen it and restore the same exact window/tab/pane splits you previously had. This is a nice perk for restarting/updating iTerm.
- jordemort 3y ago> f you use this locally instead you could then terminate the entire iterm program and reopen it and restore the same exact window/tab/pane splits you previously had. This is a nice perk for restarting/updating iTerm. iTerm seems to be able to pull this off itself during upgrades, even without tmux. The first time it happened, I was surprised, and now I just install iTerm updates with abandon, knowing that all my 40 terminal windows and all the stuff in them will come back after the update.
- riddley 3y agoI appreciate your explanation, but I'll confess that I still don't get it. I assume I'm just not understanding; please don't take offense. The state of my splits etc are already distinct from the terminal emulator as is/are the session(s) without CC. I can restart my terminal emulator or add new sessions at will without needing any special support from the terminal.
- AceJohnny2 3y agoFirst, some background: Tmux is great but (like GNU Screen) introduces a layer of abstraction between you and the shell. You have to use its special keybindings to create new windows, switch window/pane, or most annoyingly to scroll through history. Control Mode removes that layer of abstraction, so (with iTerm) you can use all the normal terminal emulator functions to do what you expect: click on panes to select them, tmux windows are just native tabs, and you can scroll the terminal natively In effect, all the UI compromises you had to do to make use of tmux... go away. It’s a huge benefit, because it means all the friction of using tmux disappears. Instead of thinking “do i really want to deal with tmux’s UX for this quick ssh session?” (it’s never as quick as you think) I just do it. All my terminal sessions are now in tmux. If I’m doing something on a remote machine, i can confidently close my laptop and know i can restore later.
- throwaway290 3y agoHow is it useful? I could never understand why I would want something like that as opposed to just using Tmux splits & terminal emulator windows. And this is the only selling point of iTerm! Everything else is strictly worse (lag, CPU/memory usage) compared to plenty of emulators.
- felixding 3y agoTmux control mode is one of the keys reasons I can't leave Mac. I also feel it's unbelievable that iTerm 2 is still the only terminal that supports this feature. For anyone who is asking why this feature is good: it's really not that easy to see the benefits from the documentation, blog or even videos, until you personally try it. At least that's the case for me.
- iamjackg 3y agoI worked on a pull request to implement it in Terminator a long time ago, but eventually gave up. Control mode was contributed to tmux by the author of iTerm2, and if you explore the iTerm2 codebase you can definitely see that they're very tied together in terms of implementation choices and general design. It's not that simple. In order to have two-way synchronization, your terminal needs to not only have an architecture where you can add a background thread that can control the "main" terminal interface, but also be flexible enough to properly size all windows and panes, and match font sizing. If your terminal supports different font sizes for every pane/split, those have to be turned off in tmux mode. There's all kinds of corner cases.