-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add powershell support to suppress UNC path error #9119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Prefer using powershell.exe over cmd.exe on wsl to supress terminal error: "CMD.EXE was started with the above path as the current directory"
A recent commit added an invalid expression to the help.fish script. The "-z" flag caused the error: "test: Missing close paren at index 11"
share/functions/help.fish
Outdated
# Try and see if powershell.exe is an option to avoid UNC path error | ||
# https://ss64.com/nt/cmd.html Launching CMD/batch files from a UNC path | ||
if type -q powershell.exe | ||
set fish_browser powershell.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inside the WSL if above.
Make it
and set -l cmd (command -s powershell.exe cmd.exe /mnt/c/Windows/System32/cmd.exe)
(powershell isn't in /mnt/c/Windows/System32 but /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe, I don't think we can hardcode the version number like that, so just the normal $PATH lookup can stay)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated conditional with the above and
statement and set fish_browser
as $cmd[1]
Thanks for the review @faho! Updates incorporated to the PR. Thanks also for all the fish-shell support. |
Merged, thanks! |
Description
powershell.exe
overcmd.exe
on wsl to supress terminal error:CMD.EXE was started with the above path as the current directory
Follow up to issue #6338
Before:

After:

Previous change that caused the
missing close paren
error linked hereff2999e
TODOs: