From bdfa7341e74a59978e2a26a85ca461d57eea68d5 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 24 Mar 2024 08:48:58 +0100 Subject: [PATCH] help: Only use `open` on macOS Unfortunately on Debian "open" is a symlink to "openvt", and there's no way from outside to tell. This prevents fish from failing because no browser could be found. --- share/functions/help.fish | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/share/functions/help.fish b/share/functions/help.fish index dd5480b1d..dd87a46a9 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -57,11 +57,9 @@ 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 + # We use the macOS open, but not otherwise. + # On Debian, there is an open command that's a symlink to openvt. + if uname | string match -q Darwin && 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