Skip to content

ArgumentOutOfRangeException - 2.1.0-beta1 #1599

Closed

Description

Environment

PS version: 7.0.1
PSReadline version: 2.1.0-beta1
os: 10.0.18362.1 (WinBuild.160101.0800)
PS file version: 7.0.1.0
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 120
BufferHeight: 50

Exception report

Environment

PSReadLine: 2.1.0-beta1
PowerShell: 7.0.1
OS: Microsoft Windows 10.0.18363
Last 200 Keys

 \ s r Tab Backspace Backspace Backspace Backspace Backspace Spacebar . \ s r j Tab Backspace Tab RightArrow Enter
 n p m Spacebar r u n Spacebar s t a r t Enter
 c d Spacebar . . \ . . Enter
 c d Spacebar . . \ . . Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace . UpArrow Enter
 c d s Backspace Spacebar . \ RightArrow Enter
 n p m Spacebar r u n Spacebar RightArrow Enter
 c d Spacebar . . \ . . Enter
 Enter
 . UpArrow Enter
 c d Spacebar . \ s r Tab RightArrow Enter
 n p m RightArrow Enter
 c d Spacebar . . RightArrow Enter
 . \ RightArrow Enter
 c d Spacebar s r Tab RightArrow Enter
 n p m Spacebar r u n Spacebar RightArrow Enter
 c d Spacebar . . Enter
 . Backspace c d Spacebar . . Enter
 . \ RightArrow Enter
 c d Spacebar . . Backspace Backspace . \ s r RightArrow Enter
 n p RightArrow Enter
 c d Spacebar . . Enter
 . . Enter
 c d Spacebar . . Enter
 UpArrow UpArrow UpArrow UpArrow Backspace Backspace Ctrl+Backspace Backspace Enter
 UpArrow Escape

Exception

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Text.StringBuilder.Insert(Int32 index, String value)
   at Microsoft.PowerShell.PSConsoleReadLine.EditItemDelete.Undo()
   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)

Steps to reproduce

I had hit Esc and this happened.

Expected behavior

No error.

Actual behavior

It errored.

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Jun 10, 2020
  2. daxian-dbw commented on Jun 10, 2020

    @daxian-dbw
    Member

    This is a duplicate of #1495. It was fixed by #1496, and is included in 2.1.0-beta2 version of PSReadLine.
    Please upgrade to 2.1.0-beta2 and give it a go.

  3. ghost removed
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Jun 10, 2020
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

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions