When using PowerShell 7 built on .NET Core 3.0:
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:
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
When using PowerShell 7 built on .NET Core 3.0:
Now use the
UpArrowkey to go back in historyExpected:
Actual:
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