Commit 969702a9 authored by Jay Soffian's avatar Jay Soffian Committed by Junio C Hamano

git-help--browse: improve browser support under OS X

/usr/bin/open <document> is used under OS X to open a document as if the
user had double-clicked on the file's icon (i.e. HTML files are opened
w/the user's default browser).
Signed-off-by: default avatarJay Soffian <[email protected]>
Acked-by: Christian Couder's avatarChristian Couder <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent d5558581
......@@ -30,7 +30,7 @@ test -f "$html_dir/git.html" || die "No documentation directory found."
valid_tool() {
case "$1" in
firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
;; # happy
*)
return 1
......@@ -94,6 +94,10 @@ if test -z "$browser" ; then
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
......@@ -140,7 +144,7 @@ case "$browser" in
;;
esac
;;
w3m|links|lynx)
w3m|links|lynx|open)
eval "$browser_path" $pages
;;
dillo)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment