Unexpected exception while using PowerShell in Windows Terminal
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- C#
- Estrelas
- 4.4k
- Forks
- 345
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PSReadLine
-
Get-PSReadLineOption emits the ListView window-size warning, so prompt modules trigger it on every shell startTalvez já em andamento @thc1006 assumiu há 64 dias. AbertaNeeds-Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
PowerShell/PSReadLine#3470 · 3 reações ·
Todas as issues de PowerShell/PSReadLine
Issues semelhantes
-
VB -> C#
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
icsharpcode/CodeConverter#1301 ·
Mantenedores costumam responder em até 3 dias
-
PettingZoo wrappers send only the first action component to every action dimensionTalvez já em andamento @RaphaelFakhri assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
Unity-Technologies/ml-agents#6341 ·
Mantenedores costumam responder em até 1 dia
-
Area: World-Readiness
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
microsoft/calculator#2522 ·
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Sonarr/Sonarr#9274 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
mailto support for hyperlinkAbertaenhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100