Unexpected exception while using PowerShell in Windows Terminal
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start by reading ReplaceCharInPlace in the exception stack and trace how Vi mode handles the reported key sequence in InputLoop. The report does not identify a reliable reproduction sequence, so first reduce the recorded keys to a minimal repro on PowerShell 7.6.6 with PSReadLine 2.4.5. Done means the repro no longer throws an IndexOutOfRangeException and existing behavior remains covered by relevant tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.4.5
PowerShell: 7.6.6
OS: Microsoft Windows 10.0.26200
BufferWidth: 103
BufferHeight: 30
Last 200 Keys:
Escape F [ i ( Escape A ) + " Escape F [ i ( Escape f } f + a ) Enter Escape k A Shift+Spacebar & & Shift+Spacebar e c h o Shift+Spacebar $ M a t Tab Enter Escape k f " i Spacebar 8 3 2 8 Spacebar 8 2 8 1 2 Enter Ctrl+l Escape k Enter Escape k f " ; i Escape l a ^ Escape f " i $ Enter Ctrl+l Escape k Enter Escape k k Enter Escape k Enter Ctrl+l Escape k Enter Escape k f " i Spacebar Enter Escape k Enter [ r e g e Tab ] : : M a t Tab Backspace Backspace h Tab " 1 2 3 4 Spacebar 1 2 3 4 Spacebar 1 2 3 4 " , Spacebar " Backspace Escape p Escape l " ( ( [ 0 - 9 ] + ) \ s ) + " Ctrl+c Ctrl+l Ctrl+v Ctrl+c Escape k k k j Ctrl+c [ r e g Tab r e r e r e r e r e r e r e r e r e r e r e r e 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.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)
Screenshot
Username hidden for anonymity.
Environment data
PS Version: 7.6.6
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.5
PSReadLine EditMode: Vi
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 103
BufferHeight: 30
Steps to reproduce
I'm not exactly sure what caused this to happen. I was just playing around with PowerShell's regex matching, and then all of a sudden, this happened. Of course, I was using the Vi keybindings.
Expected behavior
No exceptions.
Actual behavior
An exception occurred all of a sudden.
- Lenguaje dominante
- C#
- Estrellas
- 4.4k
- Forks
- 345
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PowerShell/PSReadLine
-
Get-PSReadLineOption emits the ListView window-size warning, so prompt modules trigger it on every shell startPosiblemente ocupada @thc1006 la tomó hace 63 días. AbiertoNeeds-Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
PowerShell/PSReadLine#3470 · 3 reacciones ·
Todos los issues de PowerShell/PSReadLine
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
RadicalCSG/com.chisel#192 ·
Los mantenedores suelen responder en 1 día
-
area-testing p2-post-1.0 technical-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
RazorConsole/RazorConsole#447 ·
Los mantenedores suelen responder en 1 día
-
CloudEventsMiddleware decodes JSON string data for `+json` content typesPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
dapr/dotnet-sdk#1964 ·
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día