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

Aperta
#5,147 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
csharp, powershell
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C#
Stelle
4.4k
Fork
341
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSReadLine

Tutte le issue di PowerShell/PSReadLine

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.