PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.75k stars 296 forks source link

command line expansion fails after answering y to x choices to be displayed #730

Closed christiankuhtz closed 5 years ago

christiankuhtz commented 6 years ago

Environment data

Steps to reproduce or exception report
--------------------------------------
Last 61 Keys:
 A z u r e - Backspace Backspace Backspace Backspace Backspace Backspace Backspace
Backspace Backspace Backspace Backspace n E Backspace Backspace
N e w - A z u r e R m L o Tab Tab Backspace Ctrl+c UpArrow UpArrow DownArrow
N e w - A z a u r Backspace Backspace Backspace u r e R m Tab Tab y

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -23.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu)
   at Microsoft.PowerShell.PSConsoleReadLine.PossibleCompletionsImpl(CommandCompletion completions, Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.CompleteImpl(Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
lzybkr commented 6 years ago

Was this PSReadLine 2.0 or 1.2?

The bug is most likely here when completing at the bottom of the buffer.

christiankuhtz commented 5 years ago

sorry, don't know, been too long.

lzybkr commented 5 years ago

OK, I'll assume this has been fixed by #783 then.