Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bracketed Paste in SSH issue #14258

Closed
IAmIlliest opened this issue Oct 19, 2022 · 5 comments
Closed

Bracketed Paste in SSH issue #14258

IAmIlliest opened this issue Oct 19, 2022 · 5 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@IAmIlliest
Copy link

IAmIlliest commented 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.

@IAmIlliest IAmIlliest added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 19, 2022
@j4james
Copy link
Collaborator

j4james commented 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 #14129 (comment).

@IAmIlliest
Copy link
Author

IAmIlliest commented 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.

@DHowett
Copy link
Member

DHowett commented 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)

@zadjii-msft
Copy link
Member

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

@ghost
Copy link

ghost commented 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 ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants