Skip to content

Commit be537e4

Browse files
jszakmeistergitster
authored andcommitted
git-web--browse: recognize any TERM_PROGRAM as a GUI terminal on OS X
It turns out that the presence of SECURITYSESSIONID is not sufficient for detecting the presence of a GUI under Mac OS X. SECURITYSESSIONID appears to only be set when the user has Screen Sharing enabled. Disabling Screen Sharing and relaunching the shell showed that the variable was missing, at least under Mac OS X 10.6.8. On the other hand, TERM_PROGRAM seems to be set for any terminals on OS X, so just check it is set to something, instead of hardcoding "Apple_Terminal" and missing other terminals such as iTerm.app. Signed-off-by: John Szakmeister <john@szakmeister.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7b592fa commit be537e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-web--browse.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ if test -z "$browser" ; then
119119
browser_candidates="w3m elinks links lynx"
120120
fi
121121
# SECURITYSESSIONID indicates an OS X GUI login session
122-
if test -n "$SECURITYSESSIONID" \
123-
-o "$TERM_PROGRAM" = "Apple_Terminal" ; then
122+
if test -n "$SECURITYSESSIONID" || test -n "$TERM_PROGRAM"
123+
then
124124
browser_candidates="open $browser_candidates"
125125
fi
126126
# /bin/start indicates MinGW

0 commit comments

Comments
 (0)