Skip to content

Tab completion on just $ breaks PSReadLine #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pavelbraginskiy opened this issue Jun 18, 2018 · 6 comments
Closed

Tab completion on just $ breaks PSReadLine #714

pavelbraginskiy opened this issue Jun 18, 2018 · 6 comments

Comments

@pavelbraginskiy
Copy link

image

Environment data

PS version: 6.1.0-preview.2
PSReadline version: 2.0.0-beta2
os: Linux ThinkPad 4.16.15-300.fc28.x86_64 #1 SMP Tue Jun 12 00:42:35 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
PS file version: 

Steps to reproduce or exception report

Last 3 Keys:
 $ 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 -2.
   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)
-----------------------------------------------------------------------


@vors
Copy link
Contributor

vors commented Jun 19, 2018

I can repro it on 2.0.0 beta 1 with Emacs mode.
Looks like some overflow when possible completion options don't fit on one screen.

@bgshacklett
Copy link

I believe this may be captured in #663.

@erichiller
Copy link

erichiller commented Sep 26, 2018

I think I have this same issue, I'd rather not duplicate ticket.
At $HOMEPROFILE dir I did cat C:\users\<me>\.ssh\<tab><tab>

And Received:

 UpArrow Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete p i n g Space Enter
 s s h Space v m Backspace Backspace Backspace Backspace Backspace Backspace c a t Space ~ / . s s h Tab Tab Tab Tab Tab

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 9999.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu, Boolean menuSelect)
   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, CancellationToken cancellationToken)

@lzybkr
Copy link
Contributor

lzybkr commented Sep 26, 2018

I think this was fixed in 2.0.0-beta3 - maybe you can give it a try?

@erichiller
Copy link

Again, apologies for the delay @lzybkr - It does work when running vanilla powershell now. If I use oh-my-posh then it appears the script block is not being processed or some such, the second time around. I put an issue there with far more detail if you think this is related. oh-my-posh 116

@lzybkr
Copy link
Contributor

lzybkr commented Nov 12, 2018

OK, I'm resolving as fixed by #704 and #783.

@lzybkr lzybkr closed this as completed Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants