Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Up Arrow In Integrated Terminal After F8 Code Run Causes System.ArgumentOutOfRangeException #764

Closed
GHRoss opened this issue Sep 24, 2018 · 4 comments
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException

Comments

@GHRoss
Copy link

GHRoss commented Sep 24, 2018

Environment data

PS version: 6.1.0
PSReadline version: 2.0.0-beta3
os: Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
PS file version: n/a

Steps to reproduce or exception report

Last 3 Keys:

 ` UpArrow DownArrow

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 -23.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
   at Microsoft.PowerShell.PSConsoleReadLine.NextHistory(Nullable`1 key, Object arg)
   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, CancellationToken cancellationToken)

Run large chunk of code with F8 in VSCode.
Go to the integrated terminal.
Press the up arrow.

@SeeminglyScience
Copy link
Contributor

@GHRoss Could you try manually adding the same snippet to history outside of VSCode and see if it does the same thing?

[Microsoft.PowerShell.PSConsoleReadLine]::AddToHistory($text)

I think this is due to System.Console's cursor API's only being aware of the viewport for Unix-like.

@GHRoss
Copy link
Author

GHRoss commented Sep 25, 2018

@GHRoss Could you try manually adding the same snippet to history outside of VSCode and see if it does the same thing?

[Microsoft.PowerShell.PSConsoleReadLine]::AddToHistory($text)

I think this is due to System.Console's cursor API's only being aware of the viewport for Unix-like.

So you'd want me to put it in a here string and assign it to $text?

@SeeminglyScience
Copy link
Contributor

@GHRoss Yes that's right. Outside of VSCode, assign to $text a here string containing the code you invoked with F8 when that error occurred. Then invoke that method and try pressing UpArrow again.

@joeyaiello joeyaiello added the OutOfRange Issues relating to System.ArgumentOutOfRangeException label Jun 18, 2019
@daxian-dbw
Copy link
Member

Fixed by #979 and #967

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException
Projects
None yet
Development

No branches or pull requests

4 participants