Open ericwj opened 1 year ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @dotnet/area-system-console See info in area-owners.md if you want to be subscribed.
Author: | ericwj |
---|---|
Assignees: | - |
Labels: | `area-System.Console`, `untriaged` |
Milestone: | - |
I really hope this gets fixed. The current behavior is broken.
Maybe this could fix https://github.com/PowerShell/PSReadLine/issues/105 ?
I've got a Dell Latitude 5420 around here which prints nothing if when I run [Console]::ReadKey()
and then hit alt+left
or alt+right
Description
The following character is erroneously interpreted as the escape character U+001B:
← Leftwards Arrow U+2190
Hence instead of seeing a left arrow in the console as expected, I can write ANSI escapes only using this non-control-character. But the obvious downside is that I cannot show the left arrow character in the console.
More generally
Thus instead of printing the IBM-437 graphemes for the Unicode code points listed below, these code points are interpreted as the C0 control characters 1-31.
By typing
Alt+1
..Alt+31
I am able to produce the IBM-437 graphemes used in DOS for control characters if you would write the bytes 1-31 to the video memory directly:☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼
Which GitHub apparently is able to show very colorfully:
☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼
These are however the following Unicode code points (from 1 to 31):
Those between
Alt+7
andAlt+15
andAlt+27
don't show correctly.These correspond to
\a\b\t\n\v\f\r
(\u0007
-\u000d
) and escape (\u001b
). The other two are\u000e
(SI
Shift In) and\u000f
(SO
Shift Out).Reproduction Steps
Actual behavior
Expected behavior
Regression?
I have seen this a few years before when source generators were new and on my old computer with Windows 10 at that time.
Known Workarounds
Nope, I think I am stuck with just ↑↓→ as far as those arrows are concerned.
Configuration
Windows Terminal 1.15.3466.0 Windows 11 10.0.22621.1105
Other information
Could argue it is translating the Unicode to a single-byte code page, but then I seriously don't get why I get ANSI VT processing without doing anything. If anyone would have called the appropriate API's to enable VT processing by default, why hadn't it also enabling Unicode? AFAIK both are compat breaking changes for old console apps.