Skip to content

Error popped up while typing #4102

@lorenpike

Description

@lorenpike

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.3958
OS: Microsoft Windows 10.0.22621
Last 39 Keys

 Escape k k k k k k j j j j j j j c d c i c d s a d f Backspace Backspace Backspace c d Spacebar M : / m e Escape Tab r e

Exception

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Text.StringBuilder.get_Chars(Int32 index)
   at Microsoft.PowerShell.PSConsoleReadLine.ReplaceCharInPlace(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)

Screenshot

image

Environment data

PS Version: 5.1.22621.3958
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.0.0
PSReadLine EditMode: Vi
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 118
BufferHeight: 98

Steps to reproduce

Not sure what happened.

I do have vi mode set in PowerShell, if that is relevant

Expected behavior

No exception

Actual behavior

Mid-type, the error occurred and then returned to a new line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions