diff options
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r-- | lib/functions.zsh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index dfcc4d961..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 } @@ -56,7 +63,7 @@ function takegit() { } function take() { - if [[ $1 =~ ^(https?|ftp).*\.tar\.(gz|bz2|xz)$ ]]; then + if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then takeurl "$1" elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then takegit "$1" |