summaryrefslogtreecommitdiff
path: root/lib/functions.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2023-03-18 16:23:39 -0700
committerTuowen Zhao <ztuowen@gmail.com>2023-03-18 16:23:39 -0700
commit4b0bbc0b263a150eb9a9b59f196914629be06a9b (patch)
tree619723cfa449f93149b766ee397f85ce2acef5f7 /lib/functions.zsh
parentdb7efd2336e4dbe6abf321b00dbc11bc5afb1355 (diff)
parent72732a224e886933df6b64a49ec6f5e94c884612 (diff)
downloadzsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.gz
zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.bz2
zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.zip
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r--lib/functions.zsh9
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"