Skip to content

Terminal in VSCode threw error while typing #875

Closed

Description

@lojk200775

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)

Activity

  1. daxian-dbw commented on Jul 18, 2019

    @daxian-dbw
    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.

  2. daxian-dbw commented on Sep 12, 2019

    @daxian-dbw
    Member

    Fixed by #967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OutOfRangeIssues relating to System.ArgumentOutOfRangeException

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions