You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PSConsoleReadLine crashes with System.ArgumentOutOfRangeException when typing path #5153
& Space C : \ U s e r s
3. Exception occurs during input rendering
Expected behavior
Console input should render normally without crashing.
Actual behavior
PSConsoleReadLine throws the following exception:
System.ArgumentOutOfRangeException: Значение должно быть больше или равно нулю и меньше, чем размер буфера в данной размерности.
Фактическое значение было -2.
в System.Console.SetCursorPosition(Int32 left, Int32 top)
в Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
в Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
в Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
в Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
в Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) в Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
в Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
в Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery.
See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.
Activity
AxelViet commentedon May 24, 2026
The issue happened multiple times while typing paths in PowerShell.
Looks related to cursor rendering producing a negative cursor position (
-2).I can reproduce it intermittently during fast typing/editing of command lines.
github-actions commentedon May 24, 2026
This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery.
See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.