valid_tool() {
case "$1" in
- firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
+ firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
;; # happy
*)
return 1
}
init_browser_path() {
- browser_path=`git config browser.$1.path`
- test -z "$browser_path" && browser_path=$1
+ browser_path=$(git config "browser.$1.path")
+ test -z "$browser_path" && browser_path="$1"
}
while test $# != 0
else
browser_candidates="w3m links lynx"
fi
+ # SECURITYSESSIONID indicates an OS X GUI login session
+ if test -n "$SECURITYSESSIONID"; then
+ browser_candidates="open $browser_candidates"
+ fi
for i in $browser_candidates; do
init_browser_path $i
;;
esac
;;
- w3m|links|lynx)
+ w3m|links|lynx|open)
eval "$browser_path" "$@"
;;
dillo)