ofd: better version of the fix

This commit is contained in:
Bartek Pacia 2024-04-08 18:30:41 +01:00
commit 24401b114a
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View file

@ -15,6 +15,8 @@ function upgrade_oh_my_zsh() {
function open_command() {
local open_cmd
local args=("$@")
[ "${#args[@]}" = 0 ] && args=("$PWD")
# define the open command
case "$OSTYPE" in
@ -32,12 +34,12 @@ function open_command() {
# 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" "$@"
if [[ -n "$BROWSER" && "${args[@]}" = (http|https)://* ]]; then
"$BROWSER" "$args"
return
fi
${=open_cmd} "$@" &>/dev/null
${=open_cmd} "${args[@]}" &>/dev/null
}
# take functions