Open flying-sheep opened 8 years ago
I'm not certain what iTerm2 is doing here, but whenever I read that a terminal has an 'integration,' my first thought is 'layering violation.'
tmux -CC
opens tmux in a mode called 'control mode,' which is documented here. This seems to be some sort of custom client/server protocol for communicating with tmux that is distinct from ANSI protocol, and designed for the kinds of integration that iTerm2 provides.
It's conceivable, if this protocol is robust, well-specified, and complete, that notty would implement a client for this protocol, to interact with terminal multiplexers. This would not be a tmux-specific integration, it would be a different way of transmitting commands between notty and the controlling process. There's not enough documentation on tmux's man page (and I haven't found any other documentation yet) for me to tell exactly how this protocol works.
The exact implementation in iTerm2, where when you run tmux -CC
through an iTerm2 terminal, it connects that to another window, is unlikely to be implemented as a part of notty. But some other interface is conceivable if the underlying protocol is good.
That said, rather than focusing on the integration with tmux, its worth asking:
Possibly, implementing a client for tmux's protocol is the general purpose answer, but possibly there's something else we could do instead / as well.
my idea is separation of concerns: instead of providing windows, panes, scrollback, … it could be deferred to tmux.
just food for thought, no more.
My impression of iTerm2's tmux integration (though I haven't used it extensively) is that it runs in the opposite direction: it provides tmux's decoupling ability (so that when you close the window, the tty doesn't die) while using iTerm2's display features.
yes, that’s what i meant:
Element | iTerm2 + tmux | terminal emulator | TTY |
---|---|---|---|
interface | OS window | OS window | screen |
inside | tmux window | scrollback buffer | scrollback buffer |
close btn | detaches | kills process running in terminal | N/A |
what iterm2 does is amazing, so let’s do that!