mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Revert "ofd: better version of the fix"
This reverts commit 24401b114a.
This commit is contained in:
parent
24401b114a
commit
21680a70b0
2 changed files with 4 additions and 6 deletions
|
|
@ -15,8 +15,6 @@ function upgrade_oh_my_zsh() {
|
||||||
|
|
||||||
function open_command() {
|
function open_command() {
|
||||||
local open_cmd
|
local open_cmd
|
||||||
local args=("$@")
|
|
||||||
[ "${#args[@]}" = 0 ] && args=("$PWD")
|
|
||||||
|
|
||||||
# define the open command
|
# define the open command
|
||||||
case "$OSTYPE" in
|
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.
|
# If a URL is passed, $BROWSER might be set to a local browser within SSH.
|
||||||
# See https://github.com/ohmyzsh/ohmyzsh/issues/11098
|
# See https://github.com/ohmyzsh/ohmyzsh/issues/11098
|
||||||
if [[ -n "$BROWSER" && "${args[@]}" = (http|https)://* ]]; then
|
if [[ -n "$BROWSER" && "$1" = (http|https)://* ]]; then
|
||||||
"$BROWSER" "$args"
|
"$BROWSER" "$@"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${=open_cmd} "${args[@]}" &>/dev/null
|
${=open_cmd} "$@" &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# take functions
|
# take functions
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||||
|
|
||||||
# Open the current directory in a Finder window
|
# Open the current directory in a Finder window
|
||||||
alias ofd='open_command'
|
alias ofd='open_command $PWD'
|
||||||
|
|
||||||
# Show/hide hidden files in the Finder
|
# Show/hide hidden files in the Finder
|
||||||
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
|
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue