Skip to content
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

ArgumentOutOfRangeException @ PSConsoleReadLine #1568

Closed
vivekragunathan opened this issue May 30, 2020 · 2 comments
Closed

ArgumentOutOfRangeException @ PSConsoleReadLine #1568

vivekragunathan opened this issue May 30, 2020 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@vivekragunathan
Copy link

vivekragunathan commented May 30, 2020

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 28 Keys:
 UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow DownArrow DownArrow DownArrow Enter
 UpArrow Enter
 w s l Space - - v e r s i o n Enter
 Ctrl+l

Exception:
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.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label May 30, 2020
@davinci26
Copy link

I run into the same issue here with the following error:

Environment

PSReadLine: 2.0.0-rc1
PowerShell: 5.1.19041.1
OS: Microsoft Windows 10.0.19041
Last 200 Keys

 LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Backspace Backspace Backspace Backspace Backspace Backspace N a Tab Enter
 G E t - Backspace Backspace Backspace e t 0 Backspace - V a r i a b l e Spacebar * D Backspace D e v i c e Enter
 UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace D Backspace Spacebar D e v c e Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace b l e Spacebar * d Backspace - D e v Enter
 UpArrow LeftArrow LeftArrow RightArrow RightArrow LeftArrow RightArrow LeftArrow LeftArrow LeftArrow Backspace RightArrow RightArrow RightArrow i c e * Enter
 UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Spacebar = Backspace - A d d Tab Spacebar " " LeftArrow t 
e Backspace Backspace T e Backspace Backspace / t e s t m o d e : l o o p Spacebar Backspace Enter
 UpArrow Enter
 UpArrow DownArrow UpArrow UpArrow

Exception

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 12.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.UpdateFromHistory(HistoryMoveCursor moveCursor)
   at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
   at Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

@daxian-dbw
Copy link
Member

@vivekragunathan This issue was fixed (see #1315). Please upgrade to the 2.0.1 version of PSReadLine from PowerShellGallery. See the upgrading section for instructions.

@davinci26 The stack trace you reported is different, and it's likely fixed by #1306. Plase also upgrad to the 2.0.1 version of PSReadLine and give it a go. If you still able to repro after the upgrade, please open a new issue with the environment data and repro steps (when it repros with UpArrow, then the history command retrieved by that UpArrow should be reported here ideally).

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jun 4, 2020
@daxian-dbw daxian-dbw added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants