Skip to content

Commit

Permalink
git-web--browse: recognize any TERM_PROGRAM as a GUI terminal on OS X
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jszakmeister authored and gitster committed Mar 29, 2013
1 parent 7b592fa commit be537e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-web--browse.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ if test -z "$browser" ; then
browser_candidates="w3m elinks links lynx" browser_candidates="w3m elinks links lynx"
fi fi
# SECURITYSESSIONID indicates an OS X GUI login session # SECURITYSESSIONID indicates an OS X GUI login session
if test -n "$SECURITYSESSIONID" \ if test -n "$SECURITYSESSIONID" || test -n "$TERM_PROGRAM"
-o "$TERM_PROGRAM" = "Apple_Terminal" ; then then
browser_candidates="open $browser_candidates" browser_candidates="open $browser_candidates"
fi fi
# /bin/start indicates MinGW # /bin/start indicates MinGW
Expand Down

0 comments on commit be537e4

Please sign in to comment.