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

Unable to paste ASCII escape character (ASCII #001B) #10141

Closed
htravis123 opened this issue May 20, 2021 · 7 comments
Closed

Unable to paste ASCII escape character (ASCII #001B) #10141

htravis123 opened this issue May 20, 2021 · 7 comments
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@htravis123
Copy link

htravis123 commented May 20, 2021

Windows Terminal version (or Windows build number)

1.7.1033.0

Other Software

No response

Steps to reproduce

  1. Enter an SSH session to a Linux system.
  2. Copy and attempt to paste ASCII/Unicode character 0x001B, then CTRL+[.

Expected Behavior

The character ^[ should appear.

Actual Behavior

No character appears.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 20, 2021
@DHowett
Copy link
Member

DHowett commented May 20, 2021

This is by design as of #9034 -- we filter out control chars in pasted text so that rogue clipboard contents cannot break out of bracketed paste mode¹ or emit control sequences into the input stream.

What's your particular use case? We have a bindable sendInput action for sending raw data to the connected application that might be more suitable 😄, and if you're using an application that supports verbatim input (^V ^[) that may be an acceptable compromise.

¹ a safety and usability feature that allows an application to figure out when content came from the clipboard versus the keyboard

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 20, 2021
@DHowett
Copy link
Member

DHowett commented May 20, 2021

@htravis123
Copy link
Author

I just tried to set a sendInput action for ESC+[, but it isn't working. Not sure if I am doing something wrong, though.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 20, 2021
@DHowett
Copy link
Member

DHowett commented May 20, 2021

Try this one-

{ "command": { "action": "sendInput", "input": "\u001b[" }, "keys": "whatever+you+want+for+keys" },

@htravis123
Copy link
Author

Actually, I didn't need the sendInput thingy, as I was already able to send ^[. but bash isn't accepting it as input.

@DHowett
Copy link
Member

DHowett commented May 20, 2021

I don't think it's supposed to, unless you use verbatim input with ^V (you may need to unbind "paste" from ctrl+v to do that). Otherwise, it's going to expect a control sequence to follow the escape.

Verbatim input tells the connected application, if it implements it, that "the next character should be taken literally- do not attempt to parse it".

Here, I used ctrl+v, ctrl+[ to enter ^[ as a single character-

image

@htravis123
Copy link
Author

I don't think it's supposed to, unless you use verbatim input with ^V (you may need to unbind "paste" from ctrl+v to do that). Otherwise, it's going to expect a control sequence to follow the escape.

Verbatim input tells the connected application, if it implements it, that "the next character should be taken literally- do not attempt to parse it".

Here, I used ctrl+v, ctrl+[ to enter ^[ as a single character-

image

CTRL+V worked! Everything's in order. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants