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 in SetCursorPosition #2523

Closed
awfulcooking opened this issue May 31, 2021 · 1 comment
Closed

ArgumentOutOfRangeException in SetCursorPosition #2523

awfulcooking opened this issue May 31, 2021 · 1 comment

Comments

@awfulcooking
Copy link

awfulcooking commented May 31, 2021

Environment

PS version: 5.1.19041.906
PSReadline version: 2.0.0-beta2
os: 10.0.19041.1 (WinBuild.160101.0800)
PS file version: 10.0.19041.1 (WinBuild.160101.0800)
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 188
BufferHeight: 47

Exception report

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)

image

Steps to reproduce

Last 200 keys show command input to convert a wav file to ogg with ffmpeg.exe.

An hour or so later, I returned to reuse the console and pressed Ctrl+l as usual to get a fresh prompt.

Instead, got this exception. Not happened before.. thousands of invocations across constantly changing DPIs, window sizes, etc.

Upgraded Windows Terminal ~last week

Expected behavior

Pressing Ctrl+l at a command prompt should 'clear' the screen by inserting newlines, resetting the cursor position to 0,0, and re-rendering the prompt

Actual behavior

ArgumentOutOfBoundsException in SetCursorPosition

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label May 31, 2021
@daxian-dbw
Copy link
Member

This was already fixed (see #1315). Please upgrade to the 2.1.0 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.

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants