From 248200520e1c4a9e9a69f1aa9d486f2923012c04 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 27 Mar 2019 09:03:17 +0100 Subject: [PATCH] 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] --- share/functions/help.fish | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/share/functions/help.fish b/share/functions/help.fish index 977818ed7..99ca6a884 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -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