Skip to content

An exception occurs when using git autocomplete commands #3068

@scaramushe

Description

@scaramushe

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

### Environment
PSReadLine: 2.1.0
PowerShell: 5.1.22000.282
OS: Microsoft Windows 10.0.22000
BufferWidth: 126
BufferHeight: 60

Last 200 Keys

 Spacebar o r i Tab H Backspace Spacebar H E A D : L Backspace s e r e Tab Ctrl+Backspace t e m p _ o v l 2 _ h w _ f e n c e _ w a Enter
 g i t Spacebar l o g Spacebar - 2 Enter
 b r a n c h e s Enter
 g i t Spacebar c h e c k Tab Spacebar d e v e Tab Enter
 g i t Spacebar l o g - 2 Enter
 UpArrow LeftArrow LeftArrow Spacebar Enter
 g i t Spacebar l o g Spacebar - 3 Enter
 UpArrow Ctrl+Backspace Ctrl+Backspace r e s e t Spacebar 0 Backspace - - h a r Tab Spacebar o r i Tab Ctrl+Backspace d e v e Tab Enter
 UpArrow UpArrow Enter
 g i t Spacebar d i f f Enter
 b u i l d Enter
 UpArrow Enter
 c d Spacebar s r c / G Tab Enter
 b u i l d Enter
 UpArrow Enter
 UpArrow UpArrow DownArrow Enter
 UpArrow Enter
 UpArrow Enter
 UpArrow Enter
 g i t Spacebar p u s h Spacebar Backspace Backspace Backspace Backspace Backspace c Backspace l

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.22000.282
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: 10.0.22000.1 (WinBuild.160101.0800)
BufferWidth: 126
BufferHeight: 60

Steps to reproduce

use git with autocomplete - works fine
run msbuild
try using git with autocomplete - crash

seen once
The git itself is not in a good state - can't find the sha1 it is on so maybe it is related

Expected behavior

Autocomplete works, no exception

Actual behavior

The exception...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions