3 ms·
It ships with PSReadline now which gives it bash like autocomplete.
by oscillatingpie 2y ago
It ships with PSReadline now which gives it bash like autocomplete.
- TheRoque 2y agoIs it something to install separately ? Or I need to upgrade something ? I never got it to auto complete anything to be honest
- jborean93 2y agoIt's been shipped with PowerShell since v5.1 (Windows 10/Server 2016). There have been numerous updates to PSReadLine since then to add more features but tab completion has worked for years and is IMO one of the biggest selling points.
- TheRoque 2y agoWeird. Coming from the fish shell, I can't really get anything completed with PowerShell. Mostly, I want it to work with my git commands (detect my branches for example).
- jborean93 2y agoAh if you want auto completion for native commands they need to be registered first. PSReadLine provides autocompletion support but it only works by default with things builtin to PowerShell itself. For `git` there is a fairly popular module called posh-git [1] that provides auto completion support for some of the well known commands. Git for Windows also calls it out [2]. You can also provide your own custom auto complete calls with Register-ArgumentCompleter [3]. Hope this helps! [1] https://github.com/dahlbyk/posh-git https://github.com/dahlbyk/posh-git [2] https://git-scm.com/book/ms/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Powershell https://git-scm.com/book/ms/v2/Appendix-A%3A-Git-in-Other-En... [3] https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/register-argumentcompleter?view=powershell-7.4 https://learn.microsoft.com/en-us/powershell/module/microsof...
- TheRoque 2y agoThanks for the help ! I will definitely set this up. But if I have to install some extension for every single command I use, it really makes the experience tedious and sub-par compared to what I'd get on Linux..
- supernovae 2y agoonly because your linux distro is doing it for you not because bash has git completion built in.