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 #2272

Closed
pluma9 opened this issue Mar 6, 2021 · 14 comments
Closed

System.ArgumentOutOfRangeException #2272

pluma9 opened this issue Mar 6, 2021 · 14 comments
Labels
Needs-Repro There is no sufficient information on repro steps.

Comments

@pluma9
Copy link

pluma9 commented Mar 6, 2021

Environment

PSReadLine: 2.2.0-beta1
PowerShell: 7.1.2
OS: Microsoft Windows 10.0.18363
BufferWidth: 82
BufferHeight: 52

Last 200 Keys

 r i Tab Enter c o p y - w o Tab Enter UpArrow Escape UpArrow UpArrow UpArrow DownArrow Enter s c r Tab Spacebar l i n Tab Enter UpArrow Enter Escape d d i UpArrow Enter UpArrow Enter UpArrow Enter UpArrow Enter UpArrow Enter s c r i Tab Enter s c r i Tab Spacebar l i Tab Enter UpArrow Enter UpArrow Enter UpArrow Enter Escape Escape k Escape d d " h e l Escape A h e l l o Spacebar w o r l d " Spacebar - c o n Tab Spacebar " l l " Enter Escape k w w w w w d e i l i k Tab Escape b d e i c o n Tab Escape w w x Enter Escape k w w w w w d e i l i Tab Spacebar Backspace Escape l w Enter Escape k w w f l I Escape f l f l f Escape A Escape h i * Escape l l i * Enter Escape / l l i Backspace Backspace i s t Backspace Backspace s t Enter A Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Escape Escape d d

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 52.
   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.DeleteLine(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ViChordHandler(Dictionary`2 secondKeyDispatchTable, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ViChord(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 Mar 6, 2021
@daxian-dbw
Copy link
Member

@pluma9 Thanks for reporting this issue. Did you see this in VS Code terminal? Can you please provide repro steps?

@daxian-dbw daxian-dbw added Needs-Author Feedback Needs-Repro There is no sufficient information on repro steps. labels Mar 10, 2021
@bruttium

This comment has been minimized.

@iSazonov

This comment has been minimized.

@pluma9
Copy link
Author

pluma9 commented Mar 14, 2021

@pluma9 Thanks for reporting this issue. Did you see this in VS Code terminal? Can you please provide repro steps?

No, I see this in Windows Terminal (version 1.7.572.0). I'm not sure if this helps, but here's my PSReadLine configuration:

Set-PSReadLineOption -BellStyle None
Set-PSReadLineOption -EditMode Vi
Set-PSreadLineOption -PredictionSource HistoryAndPlugin
Set-PSreadLineOption -PredictionViewStyle InlineView
Set-PSReadLineKeyHandler  -Function SwitchPredictionView -Chord 'F2'

For repro steps, I haven't tried typing those last 200 keys. I encountered this while playing around with a few Powershell commands.

@daxian-dbw

This comment has been minimized.

@bruttium

This comment has been minimized.

@iSazonov

This comment has been minimized.

@iSazonov
Copy link

As for the issue, I see very strange tail in last 200 keys that is "e[e[dd" how could it be?
"`e[d" sets cursor on top line without clear screen. I don’t understand how this sequence gets inside another one that’s the same.

@daxian-dbw
Copy link
Member

@bruttium and @iSazonov Thanks for your clarification. I will hide the related conversation make the comment history for the original issue clean.

@iSazonov Do you mean the Escape d d keystrokes? It indicates the user was using the VI edit mode.

@iSazonov
Copy link

@iSazonov Do you mean the Escape d d keystrokes? It indicates the user was using the VI edit mode.

Yes. I don't understand why this comes from the user side. He switched to VI mode with hot keys and got an exception?

I see so many situations where SetCursorPosition raises an exception the reason for which is impossible to understand, that this suggests that we need to come up with some kind of smart replay so that the problem can always be reproduced.

@iSazonov
Copy link

iSazonov commented Mar 31, 2021

@daxian-dbw I see a lot of questions where regular stack trace is not that useful. What if we implement our own stack trace where we include argument values ​​and other useful information? This could make it much easier to reproduce issues.

Second suggestion is to implement "Cloud run" as start PSRL - check new version in Cloud - download new version in local cache if presents - run new version, otherwise run pre-installed old version. Of course it should be smarter than this short description. This could get rid of a lot of old versions and outdated issues.

@endo64

This comment has been minimized.

@daxian-dbw
Copy link
Member

@endo64 The Ctrl+l issue has been fixed, see #1315 for more details.

@daxian-dbw
Copy link
Member

Given that we cannot reproduce the issue, there is no further action can be taken at this point.
I will update the issue report to ask for the screenshot when the reported issue happens, which needs include the content on the terminal right before the exception happens. I think that would help the diagnosis of such issues.

For now, I will close this issue. @pluma9 if you run into a similar issue again, please report again, with the screenshot and describe the operations that lead to the exception state, as detailed as possible. Thank you!

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Repro There is no sufficient information on repro steps.
Projects
None yet
Development

No branches or pull requests

5 participants