Skip to content

IndexOutOfRangeException following an attempt to type after running dotnet build #4946

@AndrewBrobstonFilevine

Description

@AndrewBrobstonFilevine

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 ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.3
OS: Microsoft Windows 10.0.26100
BufferWidth: 133
BufferHeight: 71

Last 200 Keys:

 F V . D o c s . C o r e Spacebar t o Spacebar . N E T Spacebar 7 Backspace 8 Escape 0 C g i t Spacebar l o g Enter g i t Spacebar c o Backspace Backspace s t a t u s Enter g i t Spacebar c o m m i t Spacebar - m Spacebar " U p g r a d e Spacebar F C Backspace V . D o c s . C o r e Spacebar t o Spacebar . N E T Spacebar 8 " Enter g i t Spacebar s t a t u s Enter Enter g i t Spacebar s t a t u s Enter d o t n e t Spacebar b u i l d Spacebar F i l e v i n e . S e r v i c e s / F i l e v i n e . / Backspace S e r v i c e s . c s p r o j Spacebar - c Spacebar R e l e a s e Enter UpArrow Enter UpArrow Enter Escape . \ r u

### 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.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

The screenshot may contain sensitive information, but I can tell you that the last output was from a dotnet build command.

Environment data

PS Version: 7.5.3
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Vi
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 133
BufferHeight: 71

Steps to reproduce

I experienced a delay when attempting to type at the prompt, then I got the exception text. I do not have specific steps to reproduce. This is the first time I have encountered this message.

Expected behavior

Not having an exception.

Actual behavior

There was a delay when I attempted to type, then I got the exception test pasted earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions