Skip to content

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

Merged
merged 5 commits into from
Aug 8, 2022

Conversation

spiffcs
Copy link
Contributor

@spiffcs spiffcs commented Aug 6, 2022

Description

  1. 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

Follow up to issue #6338

Before:
image

After:
image

  1. Add space for "-z" flag in help.fish. The new flag was causing the following error:
    image

Previous change that caused the missing close paren error linked here
ff2999e

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

spiffcs added 2 commits August 6, 2022 13:39
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"
@spiffcs spiffcs changed the title Add powershell support to suppress UNC path error; Revert Add powershell support to suppress UNC path error Aug 6, 2022
# 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
Copy link
Member

@faho faho Aug 8, 2022

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)

Copy link
Contributor Author

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]

@spiffcs
Copy link
Contributor Author

spiffcs commented Aug 8, 2022

Thanks for the review @faho!

Updates incorporated to the PR.

Thanks also for all the fish-shell support.

@faho faho added this to the fish 3.6.0 milestone Aug 8, 2022
@faho faho merged commit 275eb9d into fish-shell:master Aug 8, 2022
@faho
Copy link
Member

faho commented Aug 8, 2022

Merged, thanks!

@spiffcs spiffcs deleted the add-help-powershell-option branch August 8, 2022 19:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants