diff options
author | Marc Cornellà <hello@mcornella.com> | 2023-03-03 12:34:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-03 12:34:31 +0100 |
commit | 5bf7f9c83325a6cb2752e14ca01a574dbeef206e (patch) | |
tree | d5585681864563dd4242b920b5d0de6f21f5c9bb /lib | |
parent | 14978859c5b8d9385c9b836cd09c97cc08b6035b (diff) | |
download | zsh-5bf7f9c83325a6cb2752e14ca01a574dbeef206e.tar.gz zsh-5bf7f9c83325a6cb2752e14ca01a574dbeef206e.tar.bz2 zsh-5bf7f9c83325a6cb2752e14ca01a574dbeef206e.zip |
fix(lib): use `$BROWSER` in `open_command` if set (#11532)
Fixes #11098
Diffstat (limited to 'lib')
-rw-r--r-- | lib/functions.zsh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index 6e1faa6aa..1d85ea38a 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -30,6 +30,13 @@ function open_command() { ;; esac + # If a URL is passed, $BROWSER might be set to a local browser within SSH. + # See https://github.com/ohmyzsh/ohmyzsh/issues/11098 + if [[ -n "$BROWSER" && "$1" = (http|https)://* ]]; then + "$BROWSER" "$@" + return + fi + ${=open_cmd} "$@" &>/dev/null } |