Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab Completion in VS Code Terminal doesn't complete the highlighted command

When I start typing a command into the integrated pwsh terminal prompt in Visual Studio Code, auto-complete suggests some ideas.

Example:

  • I type . and the terminal suggests .\.venv\Scripts\activate:
  • enter image description here

But when I hit TAB which is my intuition to accept the suggestion, nothing happens.

How do I get the TAB key to accept the suggested command?

like image 367
SeaDude Avatar asked Oct 15 '25 09:10

SeaDude


1 Answers

This is detailed in the Using predictors in PSReadLine documentation:

  • AcceptSuggestion is built within ForwardChar, which is bound to RightArrow by default

And, if you wanna add a new handler, also detailed in the linked doc, you can use the Set-PSReadLineKeyHandler cmdlet.

For example, if you wanted to accept suggestions with Alt + A, you could do:

# `a` casing is important here, if you use `A` you'd need `Shift + Alt + A`
Set-PSReadLineKeyHandler -Chord 'alt+a' -Function AcceptSuggestion
like image 99
Santiago Squarzon Avatar answered Oct 18 '25 03:10

Santiago Squarzon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!