Skip to content

Got an unusual errror while learning powershell  #3972

@Dipencan

Description

@Dipencan

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:\WINDOWS\system32>> New-Item -Pa
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.22621.2506
OS: Microsoft Windows 10.0.22631
Last 200 Keys

 p t o n Enter
 RightArrow UpArrow " LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow " Enter
 S e t - V a r i a b l Enter
 RightArrow UpArrow e Enter
 G e t - V a r i a b l e Enter
 G Backspace S e y Backspace t Spacebar V Backspace Backspace - V a r i a b l e Spacebar " " LeftArrow LeftArrow N a m e LeftArrow LeftArrow LeftArrow LeftArrow - RightArrow RightArrow RightArrow RightArrow Spacebar RightArrow D i p e n RightArrow Spacebar _ v a l u e - Spacebar Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace - V a l u e Spacebar " " LeftArrow H Backspace H e l l o Spacebar Backspace Backspace Backspace Backspace Backspace Backspace G o o d Spacebar E v e n i n g Spacebar , Spacebar Backspace Backspace Backspace , Spacebar S o n n y Spacebar S i r Enter
 G e t Spacebar D i p e n Enter
 RightArrow UpArrow UpArrow Enter
 $ D i p e n Enter
 N e w - I t e , Backspace m Spacebar - P a

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](https://github.com/PowerShell/PSReadLine/assets/87991662/6efb1ccc-a3bb-42a3-aa14-353960a986f0)


### Environment data

```console
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.2506
OS: Microsoft Windows 10.0.22631

Steps to reproduce

Go to powershell and just type New-Item -Pa

Expected behavior

pop up message with error

Actual behavior

i was simpoly typing this commnad and thge error is just hopping in and out

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions