Created
September 6, 2022 06:49
-
-
Save shunshunNi/18bb4a851e6ad12301b5a099b435b312 to your computer and use it in GitHub Desktop.
wsl open command for fish. ref. https://zenn.dev/kaityo256/articles/open_command_on_wsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function open | |
if test (count $argv) -eq 0 | |
explorer.exe . | |
else | |
if test -f $argv[1] | |
cmd.exe /c start (wslpath -w $argv[1]) 2> /dev/null | |
else if test -d $argv[1] | |
explorer.exe (wslpath -w $argv[1]) | |
else | |
echo "open: $1 : No such file or directory" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment