Revert "ofd: better version of the fix"

This reverts commit 24401b114a.
This commit is contained in:
Bartek Pacia 2024-04-08 21:43:21 +01:00
commit 21680a70b0
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View file

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

View file

@ -4,7 +4,7 @@
0="${${(M)0:#/*}:-$PWD/$0}"
# Open the current directory in a Finder window
alias ofd='open_command'
alias ofd='open_command $PWD'
# Show/hide hidden files in the Finder
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"