Unexpected exception while using PowerShell in Windows Terminal
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 345
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/PSReadLine
-
Get-PSReadLineOption emits the ListView window-size warning, so prompt modules trigger it on every shell startForse già presa @thc1006 l’ha presa 63 giorni fa. ApertaNeeds-Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
PowerShell/PSReadLine#3470 · 3 reazioni ·
Tutte le issue di PowerShell/PSReadLine
Issue simili
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/microsoft-ui-xaml#12515 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
[v5-preview5] `func new` displays incorrect command in error message when project is not initializedApertaNeeds: Triage (Functions) v5 v5-preview5
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Azure/azure-functions-core-tools#5838 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
customer-reported needs-team-triage question server-Azure.Mcp tools-Pricing
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/mcp#4087 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Enable "remote"' featureAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100