When I start typing a command into the integrated pwsh terminal prompt in Visual Studio Code, auto-complete suggests some ideas.
Example:
. and the terminal suggests .\.venv\Scripts\activate:
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?
This is detailed in the Using predictors in PSReadLine documentation:
AcceptSuggestionis built withinForwardChar, 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With