Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It ships with PSReadline now which gives it bash like autocomplete.


Is it something to install separately ? Or I need to upgrade something ? I never got it to auto complete anything to be honest


It'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.


Weird. 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).


Ah 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 [2] https://git-scm.com/book/ms/v2/Appendix-A%3A-Git-in-Other-En... [3] https://learn.microsoft.com/en-us/powershell/module/microsof...


Thanks 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..


only because your linux distro is doing it for you not because bash has git completion built in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: