PowerShell / PSReadLine

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

Exception on tab-completion #1277

Closed CHerSun closed 4 years ago

CHerSun commented 4 years ago

Hi.

I tried to search for duplicates, but wasn't able to find one. Sorry if I missed one. I've just found this project & I'm trying it today for the very first time.

Steps to reproduce:

It throws exception:

-----------------------------------------------------------------------
Last 35 Keys:
 UpArrow UpArrow Enter
 c d Space i b Backspace Tab Tab b Tab Tab Tab Tab Backspace Backspace Backspace Tab Tab Backspace Backspace Backspace Backspace Backspace s t Tab Tab Backspace Tab 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 -188.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.EnsureMenuAndInputIsVisible(IConsole console, Int32 tooltipLineCount)   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)
-----------------------------------------------------------------------

Environment script output:

PS version: 5.1.18362.145
PSReadline version: 2.0.0-beta2
os: 10.0.18362.1 (WinBuild.160101.0800)
PS file version: 10.0.18362.1 (WinBuild.160101.0800)
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 119
BufferHeight: 27
daxian-dbw commented 4 years ago

@CHerSun I cannot reproduce the reported issue using the latest version of PSReadLine (2.0.0-rc1). Can you try out the 2.0.0-rc1 version from PowerShell Gallery and see if it still happen to you? You can follow the instructions to install the latest PSReadLine module for your windows powershell.

CHerSun commented 4 years ago

@daxian-dbw thank you. After forcefully updating PowerShellGet and PSReadLine to latest - I can no longer reproduce this too.