withoutboats / notty

A new kind of terminal
GNU Affero General Public License v3.0
2.31k stars 41 forks source link

tmux integration #37

Open flying-sheep opened 8 years ago

flying-sheep commented 8 years ago

what iterm2 does is amazing, so let’s do that!

withoutboats commented 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.

flying-sheep commented 8 years ago

my idea is separation of concerns: instead of providing windows, panes, scrollback, … it could be deferred to tmux.

just food for thought, no more.

withoutboats commented 8 years ago

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.

flying-sheep commented 8 years ago

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