richardszalay / pshosts

PowerShell cmdlets for modifying the hosts file on Windows, Linux, and macOS
MIT License
119 stars 18 forks source link

Tab completion is broken in PSCore+Linux #12

Closed richardszalay closed 7 years ago

richardszalay commented 7 years ago

PsHosts appears to largely "just work" in PSCore on Linux, but tab completion isn't working.

Taking a quick look, it's obvious why: PsHosts currently uses the older technique of monkey patching $function:tabexpansion2 to append a script but the string replacement uses `r`n to match the line ending.

Rather than make the hack worse, it would be better to add support for Register-ArgumentCompleter, falling back to the old method to maintain support of PS3-4.

richardszalay commented 7 years ago

Fixed in 4dc08e85 and released in v1.2.1