Description
I encountered an error while using PowerShell with the PSReadLine module. The error message is as follows:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. Parameter name: top Actual value was -1. at System.Console.SetCursorPosition(Int32 left, Int32 top) at Microsoft.PowerShell.PSConsoleReadLine.ForceRender() at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction) at Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable1 key, Object arg)    at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
Steps to Reproduce
- Open PowerShell using Visual Studio Code..
- Use the UpArrow key to navigate through the command history.
- Encounter the error.
Environment
PSVersion:       5.1.19041.5486
PSEdition:                      Desktop
PSCompatibleVersions:           {1.0, 2.0, 3.0, 4.0...}
BuildVersion:                   10.0.19041.5486
CLRVersion :                    4.0.30319.42000
WSManStackVersionL              3.0
PSRemotingProtocolVersion:      2.3
SerializationVersion :          1.1.0.1
Operating system: windows 10 64-bit