Skip to content

System.ArgumentOutOfRangeException #1607

Closed

Description

@dembeck

Environment

PS version: 5.1.19645.1
PSReadline version: 2.1.0-beta1
os: 10.0.19645.1 (WinBuild.160101.0800)
PS file version: 10.0.19645.1 (WinBuild.160101.0800)
HostName: ConsoleHost
BufferWidth: 267
BufferHeight: 3000

Exception report

Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md

Environment

PSReadLine: 2.1.0-beta1
PowerShell: 5.1.19645.1
OS: Microsoft Windows 10.0.19645
Last 200 Keys

 - Ctrl+Spacebar a Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace u p d a Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace u p d a t e 0 Backspace - m o d Tab Spacebar - Ctrl+Spacebar a Spacebar - Ctrl+Spacebar a Spacebar - Ctrl+Spacebar f Spacebar - Ctrl+Spacebar e RightArrow LeftArrow Spacebar Ctrl+Spacebar Spacebar LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Spacebar - Ctrl+Spacebar DownArrow DownArrow DownArrow Spacebar - Ctrl+Spacebar DownArrow DownArrow Spacebar - f Ctrl+Spacebar Ctrl+Spacebar Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Ctrl+Spacebar RightArrow RightArrow Spacebar Ctrl+Spacebar Spacebar Enter
 UpArrow LeftWindows LeftWindows Escape

Exception

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
   at Microsoft.PowerShell.PSConsoleReadLine.EditItemInsertChar.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 was just scrolling up looking at the results of commands I was testing for a script. The commands were nothing special just working with Invoke-RestMethod and Invoke-WebRequest.

Sorry, I don't have a better way to reproduce this issue.

Expected behavior

I guess for an error not to happen :-)

Actual behavior

I received the above error.

Activity

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

    @daxian-dbw
    Member

    The issue was fixed by #1496, and is included in 2.1.0-beta2 version of PSReadLine, which is available in PowerShell Gallery. Please upgrade and give it a go.

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