Escape sequence leaking to terminal on starting/attaching tmux (over ssh) #21877

Closed
opened 2026-01-31 07:57:12 +00:00 by claunia · 2 comments
Owner

Originally created by @plutonium-239 on GitHub (Jun 18, 2024).

Windows Terminal version

1.20.11381.0

Windows build number

10.0.19045.4529

Other Software

tmux (3.0a) over ssh (OpenSSH_for_Windows_9.1p1, LibreSSL 3.6.1)

Steps to reproduce

Log into ssh and attach/start a tmux session

Expected Behavior

Terminal is "clean" and only the prompt in a new tmux window is shown (if existing tmux then whatever contents were there before, unmodified).
The prompt is how you left it.

Actual Behavior

The escape sequence [?61;6;7;21;22;23;24;28;32;42c leaks to the terminal as input.
image
(Created a new tmux session) - this sequence is present at the beginning, with an extra ^[, and also in the input to the prompt.

Detaching from this and re-attaching adds this escape sequence to the prompt's input repeatedly in the active pane.

I found only these 2 threads that mention this exact sequence:

  1. wt issue #15693 relating to some problem in "NetDriver", does not seem related/I can't make sense of it
  2. wezterm issue which shows an identical problem but the issue did not see any resulting activity, just reproduction.
Additionally, here is a **debug tap** of creating a new session, starting with the `tmux` command:
␛[13;28;13;1;32;1_␛[m␍␊
␛[?2004l␛]0;[randomsshhostname]␣tmux␣~␇␛[13;28;13;0;32;1_␛[?1049h␛[22;0;0t␛[?1h␛=␛[2J␛[?12l␛[?1000l␛[?1002l␛[?1006l␛[?1005l␛[?1004h␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?1006h␛[?1002h␛[?25l␛[H␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␛[H␛[?25h␛[?12l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?1006h␛[?1002h␛[?12l␛[?25l␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␛[38;2;62;143;176m␛[40m␍␊
␣␛[38;2;224;222;244m␣0␣␣␛[38;2;144;140;170m␣␛[38;2;234;154;151mfish␣␛[38;2;246;193;119m0:fish*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[38;2;156;207;216m17:32␣␛[38;2;144;140;170m␣󰃰␣␣␣␛[38;2;234;154;151mpluto␣␛[H␛[?25h␛[m^[[?61;6;7;21;22;23;24;28;32;42cWelcome␣to␣fish,␣the␣friendly␣interactive␣shell␍␊
Type␣␛[32mhelp␣␛[mfor␣instructions␣on␣how␣to␣use␣fish␍␊
␛[?2004h␛[?12l␛[?25l␛[H^[[?61;6;7;21;22;23;24;28;32;42cWelcome␣to␣fish,␣the␣friendly␣interactive␣shell␛[K␍␊
Type␣␛[32mhelp␣␛[mfor␣instructions␣on␣how␣to␣use␣fish␛[K␛[36m␍␊
⋊>␣pluto@randomsshhostname␣⋊>␣␛[33m~␣␛[m[?61;6;7;2␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[32m␛[1m(pluto)␣␛[90m␛[22m17:32:10␛[m␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␍␊
␛[K␛[38;2;62;143;176m␛[40m␍␊
␣␛[38;2;224;222;244m␣0␣␣␛[38;2;144;140;170m␣␛[38;2;234;154;151mfish␣␛[38;2;246;193;119m0:fish*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[38;2;156;207;216m17:32␣␛[38;2;144;140;170m␣󰃰␣␣␣␛[38;2;234;154;151mpluto␣␛[3;38H␛[?25h␛[?25l␛[m␛[91m␛[3;28H[?61␛[32m;␛[91m6␛[32m;␛[91m7␛[32m;␛[91m21␛[32m;␛[91m22␛[32m;␛[91m23␛[32m;␛[91m24␛[32m;␛[91m28␛[32m;␛[91m32␛[32m;␛[91m42c␛[32m␛[1m␛[17C(pluto)␣␛[90m␛[22m17:32:10␛[3;58H␛[?25h␛[m␛[O

image

Originally created by @plutonium-239 on GitHub (Jun 18, 2024). ### Windows Terminal version 1.20.11381.0 ### Windows build number 10.0.19045.4529 ### Other Software `tmux` (3.0a) over `ssh` (OpenSSH_for_Windows_9.1p1, LibreSSL 3.6.1) ### Steps to reproduce Log into ssh and attach/start a `tmux` session ### Expected Behavior Terminal is "clean" and only the prompt in a new tmux window is shown (if existing tmux then whatever contents were there before, unmodified). The prompt is how you left it. ### Actual Behavior The escape sequence `[?61;6;7;21;22;23;24;28;32;42c` leaks to the terminal as input. ![image](https://github.com/microsoft/terminal/assets/29684689/0141afe3-2401-41ce-89a5-a3535d7c7717) (Created a new tmux session) - this sequence is present at the beginning, with an extra `^[`, and also in the input to the prompt. Detaching from this and re-attaching adds this escape sequence to the prompt's input repeatedly in the active pane. I found only these 2 threads that mention this exact sequence: 1. wt issue #15693 relating to some problem in "NetDriver", does not seem related/I can't make sense of it 2. wezterm [issue](https://github.com/wez/wezterm/issues/4167) which shows an identical problem but the issue did not see any resulting activity, just reproduction. <details> <summary> Additionally, here is a **debug tap** of creating a new session, starting with the `tmux` command: </summary> ``` ␛[13;28;13;1;32;1_␛[m␍␊ ␛[?2004l␛]0;[randomsshhostname]␣tmux␣~␇␛[13;28;13;0;32;1_␛[?1049h␛[22;0;0t␛[?1h␛=␛[2J␛[?12l␛[?1000l␛[?1002l␛[?1006l␛[?1005l␛[?1004h␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?1006h␛[?1002h␛[?25l␛[H␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␛[H␛[?25h␛[?12l␛[?12;25h␛[?12l␛[?1003l␛[?1006l␛[?2004l␛[?1006h␛[?1002h␛[?12l␛[?25l␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␛[38;2;62;143;176m␛[40m␍␊ ␣␛[38;2;224;222;244m␣0␣␣␛[38;2;144;140;170m␣␛[38;2;234;154;151mfish␣␛[38;2;246;193;119m0:fish*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[38;2;156;207;216m17:32␣␛[38;2;144;140;170m␣󰃰␣␣␣␛[38;2;234;154;151mpluto␣␛[H␛[?25h␛[m^[[?61;6;7;21;22;23;24;28;32;42cWelcome␣to␣fish,␣the␣friendly␣interactive␣shell␍␊ Type␣␛[32mhelp␣␛[mfor␣instructions␣on␣how␣to␣use␣fish␍␊ ␛[?2004h␛[?12l␛[?25l␛[H^[[?61;6;7;21;22;23;24;28;32;42cWelcome␣to␣fish,␣the␣friendly␣interactive␣shell␛[K␍␊ Type␣␛[32mhelp␣␛[mfor␣instructions␣on␣how␣to␣use␣fish␛[K␛[36m␍␊ ⋊>␣pluto@randomsshhostname␣⋊>␣␛[33m~␣␛[m[?61;6;7;2␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[32m␛[1m(pluto)␣␛[90m␛[22m17:32:10␛[m␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␍␊ ␛[K␛[38;2;62;143;176m␛[40m␍␊ ␣␛[38;2;224;222;244m␣0␣␣␛[38;2;144;140;170m␣␛[38;2;234;154;151mfish␣␛[38;2;246;193;119m0:fish*␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␛[K␛[38;2;156;207;216m17:32␣␛[38;2;144;140;170m␣󰃰␣␣␣␛[38;2;234;154;151mpluto␣␛[3;38H␛[?25h␛[?25l␛[m␛[91m␛[3;28H[?61␛[32m;␛[91m6␛[32m;␛[91m7␛[32m;␛[91m21␛[32m;␛[91m22␛[32m;␛[91m23␛[32m;␛[91m24␛[32m;␛[91m28␛[32m;␛[91m32␛[32m;␛[91m42c␛[32m␛[1m␛[17C(pluto)␣␛[90m␛[22m17:32:10␛[3;58H␛[?25h␛[m␛[O ``` ![image](https://github.com/microsoft/terminal/assets/29684689/1ec5b134-44ef-4f82-b67a-e52ee9b8afe4) </details>
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:57:13 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 18, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Jun 18, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Terminal putting ANSI Escape Code in terminal line when attaching tmux session (#16384)](https://github.com/microsoft/terminal/issues/16384), similarity score: 0.81 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@plutonium-239 commented on GitHub (Jun 18, 2024):

Closing since the issue is tmux-sensible (look at #16384's solution)
Thanks bot, you worked better than google! (that issue was not in my search results even though I did not use exact search quotes)

@plutonium-239 commented on GitHub (Jun 18, 2024): Closing since the issue is `tmux-sensible` (look at #16384's solution) Thanks bot, you worked better than google! (that issue was not in my search results even though I did not use exact search quotes)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21877