Add support for tmux Control Mode #5120

Open
opened 2026-01-31 00:05:29 +00:00 by claunia · 23 comments
Owner

Originally created by @zadjii-msft on GitHub (Nov 21, 2019).

From discussion in #532, #1000:

If we're looking at tmux for things like splits, why not implement Tmux Control Mode like iTerm on MacOS. I switch back and forth between my Macs (with iTerm2) and my Surface Laptop with WSL but WSL2 combined with a really usable terminal (comparable to iTerm2) would really make me consider leaving the Apple camp.

In #532, from @zadjii-msft:

I did not know that Tmux Control Mode even existed. That sounds really awesome, I'm totally on board with trying to make that work somehow.

Was there any further thought put into this? I love tmux control mode - it's literally the only thing keeping me tethered to MacOS at work (since only iTerm supports it, and iTerm is mac-only). If it were implemented, I'd trash my Mac and request a Windows laptop immediately.

I'd love to see it listed as a post-1.0 milestone :)

We should do this.

Docs link: https://github.com/tmux/tmux/wiki/Control-Mode

Originally created by @zadjii-msft on GitHub (Nov 21, 2019). From discussion in #532, #1000: > If we're looking at tmux for things like splits, why not implement [Tmux Control Mode](https://medium.com/@gveloper/using-iterm2s-built-in-integration-with-tmux-d5d0ef55ec30) like iTerm on MacOS. I switch back and forth between my Macs (with iTerm2) and my Surface Laptop with WSL but WSL2 combined with a _really_ usable terminal (comparable to iTerm2) would really make me consider leaving the Apple camp. > > In #532, from @zadjii-msft: > > > I did not know that Tmux Control Mode even existed. That sounds really awesome, I'm totally on board with trying to make that work somehow. > > Was there any further thought put into this? I love tmux control mode - it's literally the only thing keeping me tethered to MacOS at work (since only iTerm supports it, and iTerm is mac-only). If it were implemented, I'd trash my Mac and request a Windows laptop immediately. > > I'd love to see it listed as a post-1.0 milestone :) We should do this. Docs link: https://github.com/tmux/tmux/wiki/Control-Mode
Author
Owner

@nicm commented on GitHub (Nov 26, 2019):

Control mode isn't documented all that well but it isn't terribly complicated, if you want to do it you can feel free to ask me if you have questions.

@nicm commented on GitHub (Nov 26, 2019): Control mode isn't documented all that well but it isn't terribly complicated, if you want to do it you can feel free to ask me if you have questions.
Author
Owner

@DHowett-MSFT commented on GitHub (Nov 26, 2019):

@nicm Thanks! Maybe we can contribute a bit to the existence of control mode docs while we're at it. 😄

@DHowett-MSFT commented on GitHub (Nov 26, 2019): @nicm Thanks! Maybe we can contribute a bit to the existence of control mode docs while we're at it. :smile:
Author
Owner

@nicm commented on GitHub (Nov 26, 2019):

That would be great. There is an overview in the manual and it is easy enough to play with interactively using "tmux -C new" (instead of -CC). Plus iTerm2 has an implementation of the client side of course.

@nicm commented on GitHub (Nov 26, 2019): That would be great. There is an overview in the manual and it is easy enough to play with interactively using "tmux -C new" (instead of -CC). Plus iTerm2 has an implementation of the client side of course.
Author
Owner

@ArcticLight commented on GitHub (Dec 13, 2019):

I was actually just looking at Tmux Control Mode for work (which led me to this issue from Google) - this would be something I would really support! That, and there are already library implementations which might help; as @nicm mentioned iTerm2 implements control mode, and also I found this python library https://libtmux.git-pull.com/en/latest/ which implements the control mode client, too.

@ArcticLight commented on GitHub (Dec 13, 2019): I was actually just looking at Tmux Control Mode for work (which led me to this issue from Google) - this would be something I would really support! That, and there are already library implementations which might help; as @nicm mentioned iTerm2 implements control mode, and also I found this python library https://libtmux.git-pull.com/en/latest/ which implements the control mode client, too.
Author
Owner

@nicm commented on GitHub (Dec 16, 2019):

I don't think libtmux uses control mode.

@nicm commented on GitHub (Dec 16, 2019): I don't think libtmux uses control mode.
Author
Owner

@nicm commented on GitHub (Jan 13, 2020):

I have written a wiki entry about control mode, although it doesn't have an awful lot more than is in the manual at the moment. Still suggestions welcome - https://github.com/tmux/tmux/wiki/Control_Mode.

@nicm commented on GitHub (Jan 13, 2020): I have written a wiki entry about control mode, although it doesn't have an awful lot more than is in the manual at the moment. Still suggestions welcome - https://github.com/tmux/tmux/wiki/Control_Mode.
Author
Owner

@muodov commented on GitHub (Mar 17, 2020):

I would love to have this feature - it's one of the crucial things I miss from my MacOS days.
For those who end up here - push that Like button above! Let's make ourselves heard, surely the product team will notice this! :D

@muodov commented on GitHub (Mar 17, 2020): I would love to have this feature - it's one of the crucial things I miss from my MacOS days. For those who end up here - push that Like button above! Let's make ourselves heard, surely the product team will notice this! :D
Author
Owner

@skyline75489 commented on GitHub (Mar 3, 2021):

I think this depends heavily on the remoting abiliby in #7240 & #8135. A tmux window will have to be a different one than the window that executes tmux -CC. And they must be able to communicate with each other.

@skyline75489 commented on GitHub (Mar 3, 2021): I think this depends heavily on the remoting abiliby in #7240 & #8135. A tmux window will have to be a different one than the window that executes `tmux -CC`. And they must be able to communicate with each other.
Author
Owner

@joexue commented on GitHub (Nov 30, 2021):

One thing that prevent me from moving from Mac to Windows is the iTerm tmux control mode

@joexue commented on GitHub (Nov 30, 2021): One thing that prevent me from moving from Mac to Windows is the iTerm tmux control mode
Author
Owner

@skyline75489 commented on GitHub (Dec 1, 2021):

See also https://github.com/wez/wezterm/pull/1090

@skyline75489 commented on GitHub (Dec 1, 2021): See also https://github.com/wez/wezterm/pull/1090
Author
Owner

@skyline75489 commented on GitHub (Jan 19, 2022):

Update: part of this PR https://github.com/wez/wezterm/pull/1090 has been merged into main branch. But I think on Windows the tmux-cc feature in wezterm is still blocked by ConPTY. Haven't got the chance to try it, though.

@skyline75489 commented on GitHub (Jan 19, 2022): Update: part of this PR https://github.com/wez/wezterm/pull/1090 has been merged into main branch. But I think on Windows the tmux-cc feature in wezterm is still blocked by ConPTY. Haven't got the chance to try it, though.
Author
Owner

@jayPare commented on GitHub (Mar 31, 2022):

This would be so helpful! Any update/progress?

@jayPare commented on GitHub (Mar 31, 2022): This would be so helpful! Any update/progress?
Author
Owner

@zadjii-msft commented on GitHub (Mar 31, 2022):

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
image
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

@zadjii-msft commented on GitHub (Mar 31, 2022): Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? ![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png) That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️
Author
Owner

@joexue commented on GitHub (Jun 24, 2022):

This would be so helpful for me! Any update/progress?

+1

@joexue commented on GitHub (Jun 24, 2022): > This would be so helpful for me! Any update/progress? +1
Author
Owner

@nrclark commented on GitHub (Oct 15, 2022):

+1 for tmux control mode!

This is implemented on iTerm2 for MacOS, and it's crazy magic that gives a native feeling to working with a remote server over SSH. It's also nice because sessions are persistent across disconnect/reconnect.

If Windows Terminal learned how to use control-mode, I'd switch my work computer over in an instant. And I don't think I'm the only one.

@nrclark commented on GitHub (Oct 15, 2022): +1 for tmux control mode! This is implemented on iTerm2 for MacOS, and it's crazy magic that gives a native feeling to working with a remote server over SSH. It's also nice because sessions are persistent across disconnect/reconnect. If Windows Terminal learned how to use control-mode, I'd switch my work computer over in an instant. And I don't think I'm the only one.
Author
Owner

@shinebayar-g commented on GitHub (Dec 7, 2022):

It'd make so much sense since Windows Terminal already supports split panes, it'd fit perfectly <3 please support this @Microsoft

@shinebayar-g commented on GitHub (Dec 7, 2022): It'd make so much sense since Windows Terminal already supports split panes, it'd fit perfectly <3 please support this @Microsoft
Author
Owner

@BinaryShrub commented on GitHub (Jan 18, 2024):

Any update on this? I use iterm2 exclusively because of this integration

@BinaryShrub commented on GitHub (Jan 18, 2024): Any update on this? I use iterm2 exclusively because of this integration
Author
Owner

@iDarshan commented on GitHub (Mar 7, 2024):

Any update on this? This is the most wanted feature!

@iDarshan commented on GitHub (Mar 7, 2024): Any update on this? This is the most wanted feature!
Author
Owner

@susanthenerd commented on GitHub (Jun 27, 2024):

I would also like to see this happen. Any update?

@susanthenerd commented on GitHub (Jun 27, 2024): I would also like to see this happen. Any update?
Author
Owner

@rogerday commented on GitHub (Nov 25, 2024):

Agreed with everyone this is absolutely a killer feature in iTerm, once you've got used to it it's really annoying to have to use another terminal.

@rogerday commented on GitHub (Nov 25, 2024): Agreed with everyone this is absolutely a killer feature in iTerm, once you've got used to it it's __really__ annoying to have to use another terminal.
Author
Owner

@jayPare commented on GitHub (Feb 3, 2025):

There is an ongoing PR to support Control Mode for wezterm here:
https://github.com/wez/wezterm/pull/6602

I didn't looked at the code since I'm not very familiar with Wezterm code base, but I built everything from source on Windows and tested connecting to tmux 3.4 on a Linux machine. Everything seems to work properly. If anyone is a little familiar with wezterm code base, please go ahead and review the PR.

For those that want to test it, you can build from sources using the following steps:

git clone https://github.com/wez/wezterm.git
git pull origin pull/6602/head --rebase
git submodule init
git submodule update

On Windows, you can follow the step to build from source from here:

  1. Install Strawberry Perl.
  2. Do the following command to add Strawberry Perl to you path:
    set PATH=c:\Strawberry\perl\bin;%PATH%
  3. Install Visual Studio 2022 Community Edition from here
  4. Configure it for Desktop development with C++
  5. Install MSVC version of Rust from here (most likely x86_64-pc-windows-msvc)
  6. Use cargo to build wezterm from source:
    cargo build --release
  7. Run WezTerm with the following line:
    cargo run --release --bin wezterm

If you encounter any issue, or if I forgot some steps, please let me know.

@jayPare commented on GitHub (Feb 3, 2025): There is an ongoing PR to support Control Mode for wezterm here: https://github.com/wez/wezterm/pull/6602 I didn't looked at the code since I'm not very familiar with Wezterm code base, but I built everything from source on Windows and tested connecting to tmux 3.4 on a Linux machine. Everything seems to work properly. If anyone is a little familiar with wezterm code base, please go ahead and review the PR. For those that want to test it, you can build from sources using the following steps: ``` git clone https://github.com/wez/wezterm.git git pull origin pull/6602/head --rebase git submodule init git submodule update ``` On Windows, you can follow the step to build from source from [here](https://wezfurlong.org/wezterm/install/source.html#installing-from-source): 1. Install [Strawberry Perl](https://strawberryperl.com/). 2. Do the following command to add Strawberry Perl to you path: `set PATH=c:\Strawberry\perl\bin;%PATH%` 3. Install Visual Studio 2022 Community Edition from [here](https://visualstudio.microsoft.com/downloads/) 4. Configure it for Desktop development with C++ 5. Install MSVC version of Rust from [here](https://forge.rust-lang.org/infra/other-installation-methods.html) (most likely x86_64-pc-windows-msvc) 6. Use cargo to build wezterm from source: `cargo build --release` 7. Run WezTerm with the following line: `cargo run --release --bin wezterm` If you encounter any issue, or if I forgot some steps, please let me know.
Author
Owner

@joexue commented on GitHub (May 21, 2025):

A PR #18928 for this feature is raised.
Please go to comment, review, test and criticize.

Screenshot 2025-05-13 232209

@joexue commented on GitHub (May 21, 2025): A PR #18928 for this feature is raised. Please go to comment, review, test and criticize. ![Screenshot 2025-05-13 232209](https://github.com/user-attachments/assets/a65dfaa2-55b1-4a37-a1fa-d887cd4b8531)
Author
Owner

@nrclark commented on GitHub (May 21, 2025):

@joexue fantastic!! Thanks for your hard work.

@nrclark commented on GitHub (May 21, 2025): @joexue fantastic!! Thanks for your hard work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5120