System.InvalidOperationException: Queue Empty when doing PSConsoleReadLine.ReadKey()

Aberta
#5,147 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Precisa de esclarecimento
Status de atividade
Pouca atividade
Stack de tecnologia
csharp, powershell
Domínio
cli

Direção de pesquisa

Start with the Microsoft.PowerShell.PSConsoleReadLine.ReadKey and InputLoop entries in the exception stack, focusing on the Queue.Dequeue call after compaction. Reproduce the listed PSReadLine 2.0.0 workflow in Windows Terminal, then verify that the first input no longer raises Queue empty.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs-Triage :mag:
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
[DBG]: PS C:\MtiFilm\dev\SANDBOX-B>> I don't u
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.26100.8457
OS: Microsoft Windows 10.0.26200
Last 69 Keys

 / c o l o r Enter
 c l a u s d Backspace Backspace d e Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace c e Spacebar Backspace Backspace d Spacebar \ m t i f Tab d e v Tab s Tab Tab Tab Shift+Tab Enter
 c l a u d e Enter
 I Spacebar d o n ' t Spacebar u


### Exception

System.InvalidOperationException: Queue empty.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Queue`1.Dequeue()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)


[DBG]: PS C:\MtiFilm\dev\SANDBOX-B>>
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.26100.8457
OS: Microsoft Windows 10.0.26200
Last 80 Keys

 / c o l o r Enter
 c l a u s d Backspace Backspace d e Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace c e Spacebar Backspace Backspace d Spacebar \ m t i f Tab d e v Tab s Tab Tab Tab Shift+Tab Enter
 c l a u d e Enter
 I Spacebar d o n ' t Spacebar u n d e r s t a n s d Escape


### Exception

System.InvalidOperationException: Queue empty.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Queue`1.Dequeue()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
Screenshot
Image
Environment data
PS Version: 5.1.26100.8457
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.0.0
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 61
Steps to reproduce

Randomly crashe on my first input after a compaction

Expected behavior

No exception

Actual behavior

The above exception happened. then when I tried to resume the conversation, I got this:

[DBG]: PS C:\MtiFilm\dev\SANDBOX-B>> claude --resume 1251e8d7-aaf0-45e2-8604-dff9aa3c8475
claude : Error: No deferred tool marker found in the resumed session. Either the session was not deferred, the marker
is stale (tool already ran), or it exceeds the tail-scan window. Provide a prompt to continue the conversation.
At line:1 char:1

  • claude --resume 1251e8d7-aaf0-45e2-8604-dff9aa3c8475
  •   + CategoryInfo          : NotSpecified: (Error: No defer...e conversation.:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
Linguagem predominante
C#
Estrelas
4.4k
Forks
341
Métricas de merge de PRs
Nenhum PR com merge em 30d

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PowerShell/PSReadLine

Todas as issues de PowerShell/PSReadLine

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.