ConPTY(?) inserts broken control codes into tmux sessions. #10009

Closed
opened 2026-01-31 02:09:58 +00:00 by claunia · 8 comments
Owner

Originally created by @Efreak on GitHub (Aug 5, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.959]
Windows Terminal version (if applicable): N/A.

Any other software?
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
tmux 2.6

Steps to reproduce

Open an ssh (other?) session with a running tmux session with default configuration.

Expected behavior

tmux session opens as you've left it.

Actual behavior

tmux opens with 1;0c appended to whatever was at the prompt/cursor previously. Applications that consume control characters attempt to do something with them. (I haven't run into any issues with that yet, but it's possible; mostly I'm just in nano, which only complains about Unknown sequence).


Fix

Add a line to tmux.conf: set -s escape-time 10. Do this on every remote server you log into.

I should note that this is not actually an issue with WT per say--it also affects cmd.exe (which is what I primarily use for quick, single-command sessions). However, the fix I found was located
here, which links to here as the correct place to file an issue.

Screenshots

Screenshots

Connecting to my laptop running Ubuntu 18.04.3 via WSL
Running on my laptop in WSL

Running on a remote VPS with Ubuntu 18.04.3:
Running on a remote actual-linux server

If nano is running, I get a ding and an Unknown sequence message:
Opening a session that has nano running
This one with a running editor has gotten me several times before, as I tend to leave files open, sometimes with modifications to finish later.

Originally created by @Efreak on GitHub (Aug 5, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18363.959] Windows Terminal version (if applicable): N/A. Any other software? OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 tmux 2.6 ``` # Steps to reproduce Open an ssh (other?) session with a running tmux session with default configuration. # Expected behavior tmux session opens as you've left it. # Actual behavior tmux opens with `1;0c` appended to whatever was at the prompt/cursor previously. Applications that consume control characters attempt to do something with them. (I haven't run into any issues with that yet, but it's possible; mostly I'm just in nano, which only complains about `Unknown sequence`). ---------- ## Fix Add a line to `tmux.conf`: `set -s escape-time 10`. Do this on every remote server you log into. I should note that this is not actually an issue with *WT* per say--it also affects cmd.exe (which is what I primarily use for quick, single-command sessions). However, the fix I found was located [here](https://github.com/microsoft/WSL/issues/1638), which links to here as the correct place to file an issue. ## Screenshots <details> <summary>Screenshots</summary> Connecting to my laptop running Ubuntu 18.04.3 via WSL [![Running on my laptop in WSL](https://files.catbox.moe/y7p274.png)](https://files.catbox.moe/y7p274.png) Running on a remote VPS with Ubuntu 18.04.3: [![Running on a remote actual-linux server](https://files.catbox.moe/e247a9.png)](https://files.catbox.moe/e247a9.png) If nano is running, I get a ding and an `Unknown sequence` message: [![Opening a session that has nano running](https://files.catbox.moe/e4xb52.png)](https://files.catbox.moe/e4xb52.png) This one with a running editor has gotten me several times before, as I tend to leave files open, sometimes with modifications to finish later. </details>
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Author-Feedback labels 2026-01-31 02:09:58 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 5, 2020):

Would you mind trying this with SSH 8.1 from the Win32-OpenSSH releases page? This seems very similar to the issue where Vim starts in replace mode because Win32-OpenSSH 7.7 won’t pass the escape sequence through unmodified and WT/conhost is replying to a DSR

@DHowett commented on GitHub (Aug 5, 2020): Would you mind trying this with SSH 8.1 from the [Win32-OpenSSH releases page](https://github.com/PowerShell/Win32-OpenSSH/releases)? This seems very similar to the issue where Vim starts in replace mode because Win32-OpenSSH 7.7 won’t pass the escape sequence through unmodified and WT/conhost is replying to a DSR
Author
Owner

@ghost commented on GitHub (Aug 9, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 9, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@zb140 commented on GitHub (Aug 19, 2020):

Not the OP, but I just came across this issue by searching because I'm seeing the same issue. I tried it with SSH 8.1 and I can confirm it does indeed fix the problem. And the good news is, the SSH issue tracker says v8.1 is expected to ship in the next version of WIndows (https://github.com/PowerShell/Win32-OpenSSH/issues/1646) so I can be lazy about updating all my computers if I'm willing to live with it another couple months 😉

Thanks!

@zb140 commented on GitHub (Aug 19, 2020): Not the OP, but I just came across this issue by searching because I'm seeing the same issue. I tried it with SSH 8.1 and I can confirm it does indeed fix the problem. And the good news is, the SSH issue tracker says v8.1 is expected to ship in the next version of WIndows (https://github.com/PowerShell/Win32-OpenSSH/issues/1646) so I can be lazy about updating all my computers if I'm willing to live with it another couple months :wink: Thanks!
Author
Owner

@idl0r commented on GitHub (Jan 17, 2021):

Sorry but is there any chance to get an official openssh client bump that's been installed through the feature list / window?

@idl0r commented on GitHub (Jan 17, 2021): Sorry but is there any chance to get an official openssh client bump that's been installed through the feature list / window?
Author
Owner

@DHowett commented on GitHub (Jan 18, 2021):

I’m sorry, we don’t own that component. The best place to ask would be on their repository 😄

@DHowett commented on GitHub (Jan 18, 2021): I’m sorry, we don’t own that component. The best place to ask would be on their repository :smile:
Author
Owner

@idl0r commented on GitHub (Jan 18, 2021):

Is https://github.com/PowerShell/Win32-OpenSSH the official repo for this? is that's the one that's being installed through the features setup? I just thought that you know someone there by chance, since this is an official (or kind of)Microsoft one as well?

@idl0r commented on GitHub (Jan 18, 2021): Is https://github.com/PowerShell/Win32-OpenSSH the official repo for this? is that's the one that's being installed through the features setup? I just thought that you know someone there by chance, since this is an official (or kind of)Microsoft one as well?
Author
Owner

@shivanshu3 commented on GitHub (Oct 10, 2021):

I am not able to repro this behavior on cmd.exe. It only repros on Windows Terminal for me.

@shivanshu3 commented on GitHub (Oct 10, 2021): I am not able to repro this behavior on cmd.exe. It only repros on Windows Terminal for me.
Author
Owner

@jyn514 commented on GitHub (Mar 15, 2025):

Would you mind trying this with SSH 8.1 from the Win32-OpenSSH releases page? This seems very similar to the issue where Vim starts in replace mode because Win32-OpenSSH 7.7 won’t pass the escape sequence through unmodified and WT/conhost is replying to a DSR

i am still seeing this happen with OpenSSH_for_Windows_9.5p1.

cc https://github.com/PowerShell/Win32-OpenSSH/issues/2275

@jyn514 commented on GitHub (Mar 15, 2025): > Would you mind trying this with SSH 8.1 from the [Win32-OpenSSH releases page](https://github.com/PowerShell/Win32-OpenSSH/releases)? This seems very similar to the issue where Vim starts in replace mode because Win32-OpenSSH 7.7 won’t pass the escape sequence through unmodified and WT/conhost is replying to a DSR i am still seeing this happen with `OpenSSH_for_Windows_9.5p1`. cc https://github.com/PowerShell/Win32-OpenSSH/issues/2275
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10009