Feature: Support for tmux's Control Mode
tmux has a feature called Control Mode, which allows a client i.e a terminal emulator such as Ghostty to manage tmux panes. This has the benefit of enabling native integration with the terminal emulator and by extension the host OS system, making it easier to manage buffers without having to jump through hoops imposed when using tmux directly.
Ah yes, I've been meaning to do this. I've started working on at least the tmux control mode parser. I believe I'll bring that in via a PR first before integrating more parts of Ghostty into it.
Here is a list of TODOs that I plan on doing independently so we don't have one massive PR. The checklist today doesn't necessarily map 1:1 to a PR but is the set of somewhat separable work to do:
- [x] Control Mode DCS Parser (#1946)
- [ ] Termio needs to support not executing a subprocess
- [x] Partial: #1948
- [ ] Apprt API changes to note non-subprocess-based surfaces
- [ ] Termio hooks to trigger the proper events on tmux notifications
- [ ] Parser for tmux command output (i.e.
list-windows) and the command to send for it
Nice!! I think it'll also need #189 to really make sense.
I got the control mode notification parser in in #1946. This is just one of many steps (see my first comment).
Is this the same as the tmux integration in iTerm2 (enabled by adding -CC to the tmux command)?
If so, consider this a gigantic +1 (+1M). I'm so dependent on that feature that I'll probably continue to use iTerm2 until Ghostty or another terminal emulator supports it.
@dtenenba Yes, an equivalent feature implemented in Ghostty is the intended outcome from this issue.
Sorry is this also the same as 'programmatic control' so that Vim-Tmux-Navigator works simultaneous on Nvim and a tux terminal pane?
Has this been implemented yet?
See if you can guess:
And to quote Mitchell from a couple days ago on the Ghostty Discord server:
The parsing is in good shape, well unit tested, and easy to add new commands to it (I didn't add all of them because there are a lot). The hold up at this point is the ability to create new apprt things (windows/splits/tabs) that aren't attached to a normal exec-based termio. Which is pretty fundamentally hard. But something I want to tackle
Sorry if this is irrelevant, but for those are not aware, Wezterm recently merged Tmux Control mode feature. If you subscribed to this issues because Wezterm wasn't supported it back then, give it a try now. It is currently in nightly version only I think. https://github.com/wezterm/wezterm/pull/6602