Skip to content

Regression: After using less with PowerShell Core, cursor keys return the VT100 escape sequence to ReadKey() #30670

@SteveL-MSFT

Description

@SteveL-MSFT

When using PowerShell 7 built on .NET Core 3.0:

1 | less
q # to quit

Now use the UpArrow key to go back in history

Expected:

1 | less  #since this was the last command

Actual:

nothing, as PSReadLine receives `<ESC>A` (as two key presses) which is the VT100 escape sequence for up arrow

This repros on macOS and Linux. If you use PowerShell Core 6.x (same version of PSReadLine is included) this doesn't repro as it's built on .NET Core 2.1.

Interestingly, if you use:

"`e[2J"

This is the VT100 escape sequence to clear the screen, then the up arrow returns the correct key to [Console]::ReadKey() again instead of the up arrow escape sequence.
This will block the PowerShell 7 release. PowerShell/PSReadLine#1007

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions