[UX/Windows] PowerShell swallows -- in mise exec, resulting in confusing missing <COMMAND> error #9743
Unanswered
zhangjiabo1107
asked this question in
Troubleshooting and bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug:
When using
mise exec(ormise x) in Windows PowerShell or Windows Terminal, running a command with the--separator fails because PowerShell intercepts and removes the--before passing the arguments tomise.exe. This results in a confusing error for Windows users who copy-paste commands from the documentation.Steps to reproduce:
mise x python@3.13 -- python -vWorkaround found:
The user has to escape the double-dash specifically for PowerShell. All of the following work:
Why this happens:
This is a known quirk of PowerShell's argument parser when calling native executables. The
--token is consumed by PowerShell itself, somise.exe's argument array (argv) literally does not contain the separator. Thus,clapcorrectly complains about the missing<COMMAND>.Suggested Solutions (for Developer Experience):
Since
misecannot prevent PowerShell from modifying the arguments beforehand, I suggest we improve the UX/DX for Windows users:<COMMAND>error occurs on Windows targets, append a hint. For example:Hint: If you are using PowerShell, it might be consuming the
--separator. Try escaping it like"--"or`--.misedocumentation or themise exechelp text mentioning this behavior.--optional (Alternative): If possible, fallback to treating the first argument that isn't a valid<TOOL@VERSION>format as the start of the<COMMAND>. (Though I understand this might introduce parsing ambiguity).Environment:
Beta Was this translation helpful? Give feedback.
All reactions