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

Exception after windows restart #1978

Closed
sebastienros opened this issue Nov 23, 2020 · 2 comments
Closed

Exception after windows restart #1978

sebastienros opened this issue Nov 23, 2020 · 2 comments

Comments

@sebastienros
Copy link

Computer was turned off with the terminal open, and this command not yet submitted. Upon restart, I hit "ESC" on the promt and this exception occured.

PS C:\Users\sebros.REDMOND\Documents\Projects\crank\src\Microsoft.Crank.Controller> dotnet run -- --config ..\..\samples\local\local.benchmarks.yml --scenario hello --profile local --variable warmup=5 --variable duration=15 --application.options.counterProviders Microsoft.AspNetCore.Hosting --output results.json --chart --application.framework net5.0                                                                                                           

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!

Environment

PSReadLine: 2.1.0
PowerShell: 7.1.0
OS: Microsoft Windows 10.0.19042
BufferWidth: 153
BufferHeight: 45

Last 200 Keys

 UpArrow Spacebar - - c h a r t Enter
 ' Backspace Backspace 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+RightArrow Ctrl+RightArrow Ctrl+RightArrow 5 RightArrow Backspace Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+RightArrow Ctrl+LeftArrow 1 Enter
 UpArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow RightArrow RightArrow Ctrl+RightArrow LeftArrow LeftArrow LeftArrow Shift+Ctrl+LeftArrow Shift+Ctrl+LeftArrow M i c r o s o f t - A s p N e t C o r e - S e r v e r - K e s t r e l Spacebar c o u n t e r s Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Enter
 UpArrow Spacebar - - a p p l i c a t i o n . f r a m e w o r k Spacebar n e t 5 . 0 Enter
 UpArrow 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 Shift+Ctrl+RightArrow Shift+Ctrl+RightArrow Shift+Ctrl+RightArrow Shift+Ctrl+RightArrow Shift+LeftArrow Shift+LeftArrow Shift+LeftArrow M i c r o s o f t . A s p N e t C o r e . H o s t i n g Enter
 UpArrow Enter
 VolumeDown UpArrow Escape

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 'top')
Actual value was 45.
   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.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)
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 23, 2020
@Anders-E
Copy link

Guessing I stumbled upon the same bug today. However I did not restart my computer or anything mentioned in the initial post above. I got the exception inside VSCode when I refocused the terminal tab running PowerShell and tried to clear output using Ctrl + L.

Environment

PS Version: 5.1.19041.1620
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 194
BufferHeight: 32

Last 35 Keys

Last 35 Keys:
 DownArrow p y h Backspace t h o n Space l o c Tab r Backspace s e n d Tab Enter
 UpArrow Enter
 UpArrow Enter
 UpArrow Enter
 UpArrow Enter
 UpArrow Enter
 Ctrl+l

Exception

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 -4.
   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)

@daxian-dbw
Copy link
Member

@Anders-E The issue you ran into was already fixed, see #1315 (you are using a very old version of PSReadLine). Please upgrade to the 2.2.2 version of PSReadLine.
@sebastienros Improvements was made around windows resizing in version 2.2.2 of PSReadLine, which usually is the cause for the issue you ran into with ESC. Please give that version a try and let us know if the issue happens to you again.

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

3 participants