Bracketed Paste in SSH issue #18722

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

Originally created by @IAmIlliest on GitHub (Oct 19, 2022).

Windows Terminal version

1.16.2641.0

Windows build number

10.0.19044.0

Other Software

OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
PSReadLine Powershell Module 2.2.2

Steps to reproduce

I really can't say exactly how to reproduce this, but once logged into some hosts (occasionally) via SSH, it seems to convert the session to bracketed paste, and adds the following to pasted text:
Prefix:
00~
Suffix:
01~

EDIT: To elaborate....

  • If I just open Windows Terminal and paste text from the clipboard (my shortcut is Ctrl + Shift + V), then it works. If from that same tab i then SSH to some host (raspberry pi 4 in this case) it continues to paste without bracketing. If I exit that and then SSH to some other host (a Brocade ICX6610 switch in this case), I find it is now using bracketed paste mode and inserting prefix and suffix as above.
  • I'm then unable to disable this bracketed paste (or at least, do not know of the correct way).
  • Based on this inconsistent behaviour, it is perhaps not windows terminal at fault, but I'm unsure where to start looking, perhaps in OpenSSH or PSReadLine?
  • How can I work out what layer of application (WT, PSReadLine, OpenSSH/LibreSSL, host itself) is causing this change in paste behaviour?

EDIT 2:
This relates to Bash, but explains the nature of the beast:
https://askubuntu.com/a/991550
My guess is the older shell in the brocade doesn't support bracketed paste, whilst other hosts and Windows Terminal do. This is a relatively new issue when SSH'ing to these switches from Windows Terminal, so I'm guessing something has changed in either OpenSSH or WT with respect to bracketed paste in recent versions?
How do I tell WT to disable bracketed paste?

Expected Behavior

Either consistent behaviour when SSH'ing, or preferably a method/option to enable/disable bracketed paste mode in Windows Terminal?

Actual Behavior

Inconsistent pasting of text within SSH sessions to different hosts.

Originally created by @IAmIlliest on GitHub (Oct 19, 2022). ### Windows Terminal version 1.16.2641.0 ### Windows build number 10.0.19044.0 ### Other Software OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 PSReadLine Powershell Module 2.2.2 ### Steps to reproduce I really can't say exactly how to reproduce this, but once logged into some hosts (occasionally) via SSH, it seems to convert the session to bracketed paste, and adds the following to pasted text: Prefix: 00~ Suffix: 01~ EDIT: To elaborate.... * If I just open Windows Terminal and paste text from the clipboard (my shortcut is Ctrl + Shift + V), then it works. If from that same tab i then SSH to some host (raspberry pi 4 in this case) it continues to paste without bracketing. If I exit that and then SSH to some other host (a Brocade ICX6610 switch in this case), I find it is now using bracketed paste mode and inserting prefix and suffix as above. * I'm then unable to disable this bracketed paste (or at least, do not know of the correct way). * Based on this inconsistent behaviour, it is perhaps not windows terminal at fault, but I'm unsure where to start looking, perhaps in OpenSSH or PSReadLine? * How can I work out what layer of application (WT, PSReadLine, OpenSSH/LibreSSL, host itself) is causing this change in paste behaviour? EDIT 2: This relates to Bash, but explains the nature of the beast: https://askubuntu.com/a/991550 My guess is the older shell in the brocade doesn't support bracketed paste, whilst other hosts and Windows Terminal do. This is a relatively new issue when SSH'ing to these switches from Windows Terminal, so I'm guessing something has changed in either OpenSSH or WT with respect to bracketed paste in recent versions? How do I tell WT to disable bracketed paste? ### Expected Behavior Either consistent behaviour when SSH'ing, or preferably a method/option to enable/disable bracketed paste mode in Windows Terminal? ### Actual Behavior Inconsistent pasting of text within SSH sessions to different hosts.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:22:27 +00:00
Author
Owner

@j4james commented on GitHub (Oct 20, 2022):

We've been getting a lot of these reports recently. See #14129, #14234, #14246. I'm not certain what the root cause is, but my one theory was that it's the result of a Bash and GNU Readline update that started making bracketed paste mode enabled by default. Technically I think that update was more than a year ago, but maybe it has only been widely released more recently? I don't know.

In any event, some people seem to have got it fixed by disabling that option in their .inputrc, so you may want to try that. See https://github.com/microsoft/terminal/issues/14129#issuecomment-1281557559.

@j4james commented on GitHub (Oct 20, 2022): We've been getting a lot of these reports recently. See #14129, #14234, #14246. I'm not certain what the root cause is, but my one theory was that it's the result of a Bash and GNU Readline update that started making bracketed paste mode enabled by default. Technically I think that update was more than a year ago, but maybe it has only been widely released more recently? I don't know. In any event, some people seem to have got it fixed by disabling that option in their `.inputrc`, so you may want to try that. See https://github.com/microsoft/terminal/issues/14129#issuecomment-1281557559.
Author
Owner

@IAmIlliest commented on GitHub (Oct 21, 2022):

Thanks for the response :)

In this particular case I might be able to help with one fact:
The host I'm seeing this issue on (the Brocade ICX6610 switch) hasn't had a firmware update for years. It did not used to default to bracketed paste, but now it seems to. I would suggest this is something that has just changed recently (i.e. in the last few months) in either WT, PSReadLine or OpenSSH?

Edit:
Further to that, it still works without defaulting to bracketed paste once SSH'd in, if I connect via Putty rather than WT.

@IAmIlliest commented on GitHub (Oct 21, 2022): Thanks for the response :) In this particular case I might be able to help with one fact: The host I'm seeing this issue on (the Brocade ICX6610 switch) hasn't had a firmware update for years. It did not used to default to bracketed paste, but now it seems to. I would suggest this is something that has just changed recently (i.e. in the last few months) in either WT, PSReadLine or OpenSSH? Edit: Further to that, it still works without defaulting to bracketed paste once SSH'd in, if I connect via Putty rather than WT.
Author
Owner

@DHowett commented on GitHub (Oct 21, 2022):

oh no

@stevel-msft, did y'all recently light up bracketed paste support or somesuch? If so... is it being turned off before process launch? We're seeing an increase in reports of an issue where it's on in places where it shouldn't be.

(Just spitballing, nothing conclusive yet)

@DHowett commented on GitHub (Oct 21, 2022): _oh no_ @stevel-msft, did y'all recently light up bracketed paste support or somesuch? If so... is it being turned off before process launch? We're seeing an increase in reports of an issue where it's on in places where it shouldn't be. (Just spitballing, nothing conclusive yet)
Author
Owner

@zadjii-msft commented on GitHub (Oct 21, 2022):

Hey we should probably combine this discussion with /dup #14129

@zadjii-msft commented on GitHub (Oct 21, 2022): Hey we should probably combine this discussion with /dup #14129
Author
Owner

@ghost commented on GitHub (Oct 21, 2022):

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!

@ghost commented on GitHub (Oct 21, 2022): 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#18722