assert-rs / completest

Run completions for your program
https://docs.rs/completest
Apache License 2.0
4 stars 6 forks source link

feat: Add Powershell runtime support #41

Open shannmu opened 3 months ago

shannmu commented 3 months ago

To support powershell completion test

shannmu commented 3 months ago

I've been working on test code to test support for PowerShell in clap_complete. So adding completest support for PowerShell is necessary. But I've hit a problem that I haven't figured out yet. It looks like there's some issue between pwsh (PowerShell on Linux) and the PtyProcess crate or the vt100 crate. When I open a real shell in bash using the PATH="xxx" XDG_CONFIG_HOME="xxx" pwsh --nologo command and try exhaustive \t, pwsh works fine. However, there are problems when running in a pty. Here's the output of pty for the input exhaustive \t:

+ % ����������<�D����� �����<� ��&�D3^V^C% 
    2 + action    complete  global    help      last      quote     value     
    3 + alias     generate  h         hint      pacman    V         version   ∅

I found a possibly related issue in the PowerShell community: https://github.com/PowerShell/PowerShell/issues/14932

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 9790909347

Details


Totals Coverage Status
Change from base Build 9725894785: 0.0%
Covered Lines: 0
Relevant Lines: 12

💛 - Coveralls
epage commented 3 months ago

I have mixed feelings. Most devs will be on Linux so this makes it easy to not regress. However, most contributors to this feature will likely be on Windows and won't be able to test it.

I found a possibly related issue in the PowerShell community: https://github.com/PowerShell/PowerShell/issues/14932

sigh automatically closed issues.

shannmu commented 3 months ago

Most people definitely use PowerShell on Windows. Since I'm developing on Linux, my plan is to first support PowerShell on Linux to add tests for PowerShell support in clap_complete. I'll definitely need to support PowerShell on Windows later on. But now it seems like supporting PowerShell on Linux might not be a good idea.