Escape characters surround pasted text inside ssh sessions #19383

Closed
opened 2026-01-31 06:41:43 +00:00 by claunia · 5 comments
Owner

Originally created by @yellowpattern on GitHub (Feb 13, 2023).

Windows Terminal version

1.15.3465.0

Windows build number

10.0.19045.2486

Other Software

No response

Steps to reproduce

Through use of ssh sessions inside Windows Terminals (tab'd), the application is now inserting ^[[200~ before some text and ^[[200~ after some text in some Windows, just ^[[200~ in others and also ^[[200~^[[200~^[[201~. There is inconsistent behaviour among the tabs (with respect to the exact escape sequence inserted) except to say that paste is now broken in all of them.

Expected Behavior

Plain text to be pasted.

Actual Behavior

Escape characters before and after (in some tabs).

Originally created by @yellowpattern on GitHub (Feb 13, 2023). ### Windows Terminal version 1.15.3465.0 ### Windows build number 10.0.19045.2486 ### Other Software _No response_ ### Steps to reproduce Through use of ssh sessions inside Windows Terminals (tab'd), the application is now inserting ^[[200~ before some text and ^[[200~ after some text in some Windows, just ^[[200~ in others and also ^[[200~^[[200~^[[201~. There is inconsistent behaviour among the tabs (with respect to the exact escape sequence inserted) except to say that paste is now broken in all of them. ### Expected Behavior Plain text to be pasted. ### Actual Behavior Escape characters before and after (in some tabs).
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:41:43 +00:00
Author
Owner

@yellowpattern commented on GitHub (Feb 13, 2023):

A similar problem is sometimes seen in MacOS iTerm2. That application has the ability to "Reset" a window (command-R) which resolves the problem. There is no such per-tab function available with Windows Terminal. I tried running "reset" from the terminal window and a "right-click" paste after that prints the follwing in cat:

^[[200~^[[200~^[[200~^[[201~^[[201~

@yellowpattern commented on GitHub (Feb 13, 2023): A similar problem is sometimes seen in MacOS iTerm2. That application has the ability to "Reset" a window (command-R) which resolves the problem. There is no such per-tab function available with Windows Terminal. I tried running "reset" from the terminal window and a "right-click" paste after that prints the follwing in cat: ^[[200~^[[200~^[[200~^[[201~^[[201~
Author
Owner

@yellowpattern commented on GitHub (Feb 13, 2023):

If I were to guess, judging by the comments in other tickets the problem lays in whatever it is that sends the "paste-block-start" not being able to send the "paste-block-end", potentially due to WiFi connection being lost, etc. If the only way to fix this is to quit all the infected terminal tabs, I'm not a particularly happy camper. "Don't do that", you say? We (users) are not always in a position to exit editors nicely.

@yellowpattern commented on GitHub (Feb 13, 2023): If I were to guess, judging by the comments in other tickets the problem lays in whatever it is that sends the "paste-block-start" not being able to send the "paste-block-end", potentially due to WiFi connection being lost, etc. If the only way to fix this is to quit all the infected terminal tabs, I'm not a particularly happy camper. "Don't do that", you say? We (users) are not always in a position to exit editors nicely.
Author
Owner

@237dmitry commented on GitHub (Feb 13, 2023):

This behavior is observed in some terminal emulators and without ssh if you paste text with ctrl-v instead of ctrl-shift-v or shift-insert

@237dmitry commented on GitHub (Feb 13, 2023): This behavior is observed in some terminal emulators and without ssh if you paste text with `ctrl-v` instead of `ctrl-shift-v` or `shift-insert`
Author
Owner

@carlos-zamora commented on GitHub (Feb 13, 2023):

Looks like this is a /dup of #14258. At this point, this seems to be an incompatibility issue between shells. See https://askubuntu.com/a/991550.

@carlos-zamora commented on GitHub (Feb 13, 2023): Looks like this is a /dup of #14258. At this point, this seems to be an incompatibility issue between shells. See https://askubuntu.com/a/991550.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Feb 13, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Feb 13, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19383