Skip to content

Right Arrow Complete failure, environment hang #4930

@ebmarquez

Description

@ebmarquez

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: 120
BufferHeight: 30

Last 29 Keys:

 c o d e Spacebar Backspace Backspace Backspace Backspace Backspace c d Spacebar r e p o Tab RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Tab RightArrow RightArrow RightArrow RightArrow

### Exception

System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
   at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex)
   at Microsoft.PowerShell.PSConsoleReadLine.AcceptSuggestion(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ForwardChar(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, Nullable`1 lastRunStatus)

Screenshot

Image

Environment data

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

Steps to reproduce

Open new windows terminal
(was planning to cd into my repo and start vs code)
cd (was pressing right arrow to complete the path that was presented)
(system hang and crash report issued)

Expected behavior

Select right arrow and cd into the path.

Actual behavior

crash typed the path from memory

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