xonsh / xonsh

:shell: Python-powered shell. Full-featured and cross-platform.
http://xon.sh
Other
8.32k stars 637 forks source link

Windows: Path autocompletion fails in raw strings #4557

Open eugenesvk opened 2 years ago

eugenesvk commented 2 years ago

I have two test paths: C:\App\x\a\inA C:\App\x\b\inB

When I Tab after C:\App\x\, I get both a\ and \b suggested When I Tab after r"C:\App\x\, my path changes to \\ and I get no suggestions (empty box), the second Tab reverts path to r"C:\App\x\, but the suggestion box is still empty

xonfig

``` $ xonfig +------------------+----------------------+ | xonsh | 0.11.0 | | Git SHA | 337cf25a | | Commit Date | Nov 17 15:37:41 2021 | | Python | 3.9.7 | | PLY | 3.11 | | have readline | False | | prompt toolkit | 3.0.22 | | shell type | prompt_toolkit | | history backend | json | | pygments | 2.10.0 | | on posix | False | | on linux | False | | on darwin | False | | on windows | True | | on cygwin | False | | on msys2 | False | | is superuser | False | | default encoding | utf-8 | | xonsh encoding | utf-8 | | encoding errors | surrogateescape | | on jupyter | False | | jupyter kernel | None | | xontrib | [] | | RC file | [] | +------------------+----------------------+ ```

Expected Behavior

Autocomplete within raw strings (needed for paths with spaces) works the same as without them

Current Behavior

Autocomplete fails within raw strings

Traceback (if applicable)

Steps to Reproduce

Please see a simple test above

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

WRaezer commented 2 years ago

Is this issue still open?

zstg commented 2 years ago

It’s still open

AFAIK Python on Windows (& cmd as a matter of fact) do accept the / forward slash for completions (Cmd works ,but autocomplete in cmd doesn’t)

PowerShell goes a step further- it automatically converts all forward slashes into backward slashes - Xonsh can take cues from this …

zstg commented 2 years ago

Perhaps there is a different way to do this on the MSYS/Cygwin builds?