kislyuk / argcomplete

Python and tab completion, better together.
https://kislyuk.github.io/argcomplete/
Apache License 2.0
1.39k stars 129 forks source link

Support PowerShell #392

Closed bebound closed 1 year ago

bebound commented 1 year ago

In https://github.com/kislyuk/argcomplete/pull/307, argcomplete adds the env ARGCOMPLETE_USE_TEMPFILES to redirect its output to file and supports Git Bash. We can use the same way to support powershell.

I've used it in https://github.com/Azure/azure-cli/pull/24752, and it works.

kislyuk commented 1 year ago

Thanks. How would we go about writing a unit test for this?

bebound commented 1 year ago

pexpect is not fully compatible with Windows. I can use pexpect.popen_spawn.PopenSpawn(f'PowerShell -c "echo 1"',encoding='utf-8') to get the output of command but I don't know the equivalent of self.child.sendline.

kislyuk commented 1 year ago

Hello, your PR contained invalid RST markup that prevented the package from being released on PyPI, and was reverted. Please feel free to reopen the PR after ensuring that the RST markup is valid.

bebound commented 1 year ago

Sorry, I should have added more dashes at this line. Do I need recreate the whole PR or you can edit this line?

PowerShell Support
------------------
kislyuk commented 1 year ago

Please re-open a new PR (and incorporate your README fix from the newer PR) as the old one had to be reverted to unblock the release.

On Sat, Mar 4, 2023 at 8:49 PM Hang @.***> wrote:

Sorry, I should have added more dashes at this line. Do I need recreate the whole PR or you can edit this line?

PowerShell Support

— Reply to this email directly, view it on GitHub https://github.com/kislyuk/argcomplete/pull/392#issuecomment-1454989514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSOPOGH7GSAUHS4M7K7BDW2QLNDANCNFSM6AAAAAAS6CF4EI . You are receiving this because you modified the open/close state.Message ID: @.***>