mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
functions/help: Prefer xdg-open/cygstart over open
Some systems like Debian have "open" as a symlink to "openvt" (for... historical reasons). See #5756. [ci skip]
This commit is contained in:
parent
54156845e4
commit
248200520e
1 changed files with 10 additions and 8 deletions
|
@ -54,6 +54,16 @@ function help --description 'Show help for the fish shell'
|
|||
end
|
||||
end
|
||||
|
||||
# If we have an open _command_ we use it - otherwise it's our function,
|
||||
# which might not have a backend to use.
|
||||
# Note that we prefer xdg-open, because this open might also be a symlink to "openvt"
|
||||
# like it is on Debian.
|
||||
if command -sq open
|
||||
set fish_browser open
|
||||
# The open command needs a trampoline because the macOS version can't handle #-fragments.
|
||||
set need_trampoline 1
|
||||
end
|
||||
|
||||
# If the OS appears to be Windows (graphical), try to use cygstart
|
||||
if type -q cygstart
|
||||
set fish_browser cygstart
|
||||
|
@ -62,14 +72,6 @@ function help --description 'Show help for the fish shell'
|
|||
else if type -q xdg-open; and set -q -x DISPLAY
|
||||
set fish_browser xdg-open
|
||||
end
|
||||
|
||||
# If we have an open _command_ we use it - otherwise it's our function,
|
||||
# which might not have a backend to use.
|
||||
if command -sq open
|
||||
set fish_browser open
|
||||
# The open command needs a trampoline because the macOS version can't handle #-fragments.
|
||||
set need_trampoline 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue