Skip to content

Terminal in VSCode threw error while typing #875

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

Closed
lojk200775 opened this issue Mar 27, 2019 · 2 comments
Closed

Terminal in VSCode threw error while typing #875

lojk200775 opened this issue Mar 27, 2019 · 2 comments
Labels
OutOfRange Issues relating to System.ArgumentOutOfRangeException

Comments

@lojk200775
Copy link

Environment data

PS version: 5.1.17763.316
PSReadline version: 2.0.0-beta2
os: 10.0.17763.1 (WinBuild.160101.0800)
PS file version: 10.0.17763.1 (WinBuild.160101.0800)
Steps to reproduce or exception report

Terminal Output:

d
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new

Last 200 Keys:
C o m m o n Enter
UpArrow Backspace Backspace Backspace Backspace Backspace Backspace U n i t Enter
UpArrow Insert Backspace Backspace Backspace Backspace I n t e g r a t i o n Enter
c d Space P e Tab Enter
d o t n e t Space n e w Space c l a s s l i b Enter
c d . . Enter
c d Space Tab Tab Enter
d o t n e t Space n e w Space x u n i t Enter
c d . . Enter
UpArrow UpArrow UpArrow Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace
Backspace Backspace Backspace Tab Tab Tab Enter
d o t n e t Space n e w Space x u n i t Enter
c d . . Enter
c d Space P e r Tab Tab Tab Tab Enter
d o t n e t Space n e w Space c l a s s l u Backspace i b Enter
c d . . Enter
UpArrow UpArrow UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace u n i t Tab Enter
d o

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: left
Actual value was -1.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

@daxian-dbw daxian-dbw added this to the 2.0.0-Consider milestone Jun 18, 2019
@joeyaiello joeyaiello added the OutOfRange Issues relating to System.ArgumentOutOfRangeException label Jun 18, 2019
@daxian-dbw daxian-dbw mentioned this issue Jul 16, 2019
Closed
@daxian-dbw
Copy link
Member

UpArrow UpArrow UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace u n i t Tab Enter

This set of key sequences results in cd unitxxxxx Enter. After that, do was typed which results in a parsing error because it's a keyword, and then the exception happens when trying to change the color of > in the prompt.
It's very possible that the cd unitxxxx step results in a longer prompt string that caused the line to be wrapped to the next line.

@daxian-dbw
Copy link
Member

Fixed by #967

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

No branches or pull requests

3 participants