Esc character not created ? #6092

Closed
opened 2026-01-31 00:29:36 +00:00 by claunia · 6 comments
Owner

Originally created by @SheepDomination on GitHub (Jan 22, 2020).

The Esc character when in a command line shell should create ^[ rather nothing is created; unlike in the command line shell which comes with Windows ?
Microsoft Terminal; Version: 0.7.3451.0

Originally created by @SheepDomination on GitHub (Jan 22, 2020). The `Esc` character when in a command line shell should create `^[` rather nothing is created; unlike in the command line shell which comes with Windows ? Microsoft Terminal; Version: 0.7.3451.0
claunia added the Area-InputResolution-DuplicateProduct-Terminal labels 2026-01-31 00:29:36 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 22, 2020):

@SheepDomination In what shell are you seeing esc write an escape character to the input? In cmd and powershell, esc clears the input line, and in bash it simply escapes the next character pressed. Have you changed something about the configuration for those shells that would cause a change in behavior for the legacy console?

@zadjii-msft commented on GitHub (Jan 22, 2020): @SheepDomination In what shell are you seeing <kbd>esc</kbd> write an escape character to the input? In `cmd` and `powershell`, <kbd>esc</kbd> clears the input line, and in `bash` it simply escapes the next character pressed. Have you changed something about the configuration for those shells that would cause a change in behavior for the legacy console?
Author
Owner

@SheepDomination commented on GitHub (Jan 22, 2020):

I mean it's not doing an Escape character. In the default command line shell which comes with Windows, it works; by works I mean when I use the keyboard commands crtl+[ I get ^[ but in Windows Terminal it erases the line; which is identical to that in the default command line which comes with Windows, if I have click installed.

Nothing in my configuration has been altered, I've left everything at their defaults for Windows Terminal.

@SheepDomination commented on GitHub (Jan 22, 2020): I mean it's not doing an [Escape character](https://en.wikipedia.org/wiki/Escape_character). In the default command line shell which comes with Windows, it works; by works I mean when I use the keyboard commands `crtl`+`[` I get `^[` but in Windows Terminal it erases the line; which is identical to that in the default command line which comes with Windows, if I have [click](https://github.com/mridgers/clink) installed. Nothing in my configuration has been altered, I've left everything at their defaults for Windows Terminal.
Author
Owner

@zadjii-msft commented on GitHub (Jan 22, 2020):

Okay that gives me a lot more information. There's a very real difference between Esc and Ctrl+[ in the legacy console, but unfortunately, they both map to the ESC character. This means that unfortunately, conpty (which provides the backend for the Windows Terminal) can't tell the difference between the two, and chooses to treat \x1b as Esc, not Ctrl+[.

This is related to the broader class of problems that are currently being tracked in #879, so I'm going to resolve this as a dupe. Thanks!

/dup #879

@zadjii-msft commented on GitHub (Jan 22, 2020): Okay that gives me a lot more information. There's a very real difference between <kbd>Esc</kbd> and <kbd>Ctrl+[</kbd> in the legacy console, but unfortunately, they both map to the `ESC` character. This means that unfortunately, conpty (which provides the backend for the Windows Terminal) can't tell the difference between the two, and chooses to treat `\x1b` as <kbd>Esc</kbd>, _not_ <kbd>Ctrl+[</kbd>. This is related to the broader class of problems that are currently being tracked in #879, so I'm going to resolve this as a dupe. Thanks! /dup #879
Author
Owner

@ghost commented on GitHub (Jan 22, 2020):

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 (Jan 22, 2020): 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!
Author
Owner

@SheepDomination commented on GitHub (Jan 25, 2020):

Would this also fall into the same line as pasting from the clipboard only pastes ^V when in a command line shell, rather then the contents which were cut anywhere within windows ?

@SheepDomination commented on GitHub (Jan 25, 2020): Would this also fall into the same line as pasting from the clipboard only pastes `^V` when in a command line shell, rather then the contents which were cut anywhere within windows ?
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 25, 2020):

That is unrelated.

@DHowett-MSFT commented on GitHub (Jan 25, 2020): That is unrelated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6092