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

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top') #3216

Closed
3 tasks done
TBBle opened this issue Feb 22, 2022 · 2 comments

Comments

@TBBle
Copy link

TBBle commented Feb 22, 2022

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 58.
   at System.ConsolePal.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.RevertLine(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)

Screenshot

image

Environment data

From the supplied script:

PS Version: 7.2.1
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 231
BufferHeight: 58

Output by the exception handler:

PSReadLine: 2.1.0
PowerShell: 7.2.1
OS: Microsoft Windows 10.0.19042
BufferWidth: 231
BufferHeight: 58

Last 200 Keys

 - f f l a g s Spacebar + s h o r t e s t Spacebar Enter
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow LeftArrow LeftArrow Spacebar - f f l a g s Spacebar + s h o r t e s t Enter
 UpArrow UpArrow DownArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow LeftArrow LeftArrow LeftArrow Spacebar - f f l a g s Spacebar + s h o r t e s t Enter
 UpArrow Ctrl+c UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow UpArrow UpArrow UpArrow UpArrow DownArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Delete Delete Delete 8 4 7 Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Delete RightArrow 6 RightArrow RightArrow RightArrow Delete 3 RightArrow Delete 6 End Enter
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow End Ctrl+LeftArrow Ctrl+LeftArrow Escape

Steps to reproduce

No idea. I just hit 'Escape' to clear the line so I could exit the terminal.

The relevant line was probably at the bottom of the buffer at the time.

Expected behavior

Line cleared when I hit escape.

Actual behavior

Exception report, looks like it deleted two characters before excepting.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Feb 22, 2022
@TBBle
Copy link
Author

TBBle commented Feb 22, 2022

This could be the same underlying issue as #2298. However, that is against 2.2.0 beta, has a slightly different stack trace (maybe due to refactoring), and is apparently only seen in the VS Code PowerShell integrated terminal, where this happend in Windows Terminal 1.11.3471.0.

@daxian-dbw
Copy link
Member

@TBBle The issue you ran into is likely the same as #1884, which was fixed in the most recent 2.2.1-rc1 release. Please upgrade to the latest PSReadLine and give it a try.

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Feb 22, 2022
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