Skip to content

Commit 969702a

Browse files
jaysoffiangitster
authored andcommitted
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: Jay Soffian <jaysoffian@gmail.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d555858 commit 969702a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

git-help--browse.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test -f "$html_dir/git.html" || die "No documentation directory found."
3030

3131
valid_tool() {
3232
case "$1" in
33-
firefox | iceweasel | konqueror | w3m | links | lynx | dillo)
33+
firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open)
3434
;; # happy
3535
*)
3636
return 1
@@ -94,6 +94,10 @@ if test -z "$browser" ; then
9494
else
9595
browser_candidates="w3m links lynx"
9696
fi
97+
# SECURITYSESSIONID indicates an OS X GUI login session
98+
if test -n "$SECURITYSESSIONID"; then
99+
browser_candidates="open $browser_candidates"
100+
fi
97101

98102
for i in $browser_candidates; do
99103
init_browser_path $i
@@ -140,7 +144,7 @@ case "$browser" in
140144
;;
141145
esac
142146
;;
143-
w3m|links|lynx)
147+
w3m|links|lynx|open)
144148
eval "$browser_path" $pages
145149
;;
146150
dillo)

0 commit comments

Comments
 (0)