fix(lib): use $BROWSER in open_command if set (#11532)

Fixes #11098
This commit is contained in:
Marc Cornellà 2023-03-03 12:34:31 +01:00 committed by GitHub
parent 14978859c5
commit 5bf7f9c833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}