Description
Description
This is with PowerShell 7.3.0-preview.7, which runs on top of .NET 7-preview.7.
Running [System.Console]::ReadKey()
in PowerShell, and then press UpArrow, it returns the escape sequences character by character -- Escape
and then A
.
It's the same to other arrow keys: DownArrow, LeftArrow, RightArrow
However, when using Console.ReadKey
in an EXE built against .NET 7-preview.7, it returns UpArrow
(and other arraow keys) as expected. Any ideas about what may cause this difference?
Related PowerShell issue: PowerShell/PowerShell#16443
Reproduction Steps
- Run PowerShell 7.3.0-preview.3, which runs on top of .NET 7-preview.7.
- Run
[System.Console]::ReadKey()
- Press UpArrow
Expected behavior
[System.Console]::ReadKey()
returns a ConsoleKeyInfo
with those values: KeyChar: 0, Key: UpArrow, Modifier: 0
Actual behavior
[System.Console]::ReadKey()
returns a ConsoleKeyInfo
with the Escape
key, and then a second ReadKey
returns A
However, when using Console.ReadKey
from an EXE that's built against .NET 7-preview.7, it works as expected:
Regression?
Not as far as I know. I observe the same behavior in .NET 6.
Known Workarounds
No response
Configuration
Which version of .NET is the code running on?
.NET 7-preview.7
What OS and version, and what distro if applicable?
Ubuntu 18.04
What is the architecture (x64, x86, ARM, ARM64)?
x64
Other information
No response