-
Notifications
You must be signed in to change notification settings - Fork 318
Closed
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Resolution-Fixed
Description
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
### Environment
PSReadLine: 2.2.5
PowerShell: 7.2.4
OS: Microsoft Windows 10.0.22000
BufferWidth: 110
BufferHeight: 45
Last 94 Keys:
UpArrow DownArrow DownArrow " Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace
### Exception
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Text.StringBuilder.get_Chars(Int32 index)
at Microsoft.PowerShell.PSConsoleReadLine.ConvertOffsetToPoint(Int32 offset)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Render()
at Microsoft.PowerShell.PSConsoleReadLine.BackwardDeleteChar(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
Environment data
PS Version: 7.2.4
PS HostName: ConsoleHost
PSReadLine Version: 2.2.5
PSReadLine EditMode: Windows
OS: 10.0.22000.1 (WinBuild.160101.0800)
BufferWidth: 136
BufferHeight: 16
Steps to reproduce
- Run PowerShell without a profile (
pwsh -noprofile
). - In a new prompt, run
Set-PSReadlineOption -PredictionSource 'HistoryAndPlugin' -PredictionViewStyle 'ListView'
. This is the paramount prerequisite. - Enter a single or double quote character (
'
/"
). This line is the "initial line". - Press Enter repeatedly in a continuation prompt context until the "initial line" is out of the upper bound of the terminal screen buffer.
- Press Backspace repeatedly in a continuation prompt until the "initial line" is back.
- The above exception happens.
Something weird: The exception does not happen when there are five or more characters (including the unmatched quote) in the "initial line".
Expected behavior
No exception.
Actual behavior
The above exception happens.
rafek1241rafek1241
Metadata
Metadata
Assignees
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Resolution-Fixed