-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Console.ReadKey
behaves differently in .NET 6 comparing to .NET 5 when TERM
is set to rxvt
#63387
Comments
Tagging subscribers to this area: @dotnet/area-system-console Issue DetailsDescriptionWe got a report in PowerShell repo about "arrow keys not functioning properly in PowerShell 7.2 with It turns out However, in .NET 6, the the It's not like But it's been reported that setting So, are Reproduction Steps
Expected behaviorLeftArrow and RightArrow should move the cursor left and right; Actual behaviorArrow keys are not working as expected. Regression?Yes. Known WorkaroundsSetting ConfigurationNo response Other informationNo response
|
In expected behavior: |
Yes, it was reported that arrow keys worked as expected after setting
|
Any updates on this issue? It causes issues in PowerShell Core 7.2 because of update to .NET 6. |
Description
We got a report in PowerShell repo about "arrow keys not functioning properly in PowerShell 7.2 with
rxvt
terminals", see PowerShell/PowerShell#16606.It turns out
Console.ReadKey
behaves differently in .NET 6 comparing to .NET 5 whenTERM
is set torxvt
.In .NET 5, the
ConsoleKeyInfo
returned for LeftArrow doesn't has any modifiers, as shown below:However, in .NET 6, the the
ConsoleKeyInfo
returned for LeftArrow hasControl
andShift
modifiers specified, as shown below:It's not like
Console.ReadKey
always work properly in .NET 5 withrxvt
terminals, for example, Home returnsEscape+H
(it returnsOH
in .NET 6), and End returnsEscape+F
(it returnsOF
in .NET 6), instead ofHome
andEnd
as expected.But it's been reported that setting
TERM=xterm
would makeConsole.ReadKey
work as expected with regard to arrow keys withrxvt
terminals -- see PowerShell/PowerShell#16606 (comment).So, are
rxvt
terminals really supported by .NET 5/6? If so, what configurations should be done to make it work properly withConsole.ReadKey
?Reproduction Steps
export TERM=rxvt
Expected behavior
LeftArrow and RightArrow should move the cursor left and right;
LeftArrow and RightArrow should go through history commands.
Actual behavior
Arrow keys are not working as expected.
Home and End prints
OH
andOF
respectively.Regression?
Yes.
Known Workarounds
Setting
TERM=xterm
would makeConsole.ReadKey
work as expected withrxvt
terminals.Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: