summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar John Szakmeister <john@szakmeister.net>2013-03-25 06:13:18 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-03-29 15:24:31 -0700
commitbe537e43ca8c6e38a3cf7024b28d6daf54611132 (patch)
treed465ab538aa5e20b3a4d69c296cbf94d1e67b113
parentUpdate draft release notes to 1.8.3 (diff)
downloadtgif-be537e43ca8c6e38a3cf7024b28d6daf54611132.tar.xz
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>
-rwxr-xr-xgit-web--browse.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-web--browse.sh b/git-web--browse.sh
index 1e827264b4..9f446798d4 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -119,8 +119,8 @@ if test -z "$browser" ; then
browser_candidates="w3m elinks links lynx"
fi
# SECURITYSESSIONID indicates an OS X GUI login session
- if test -n "$SECURITYSESSIONID" \
- -o "$TERM_PROGRAM" = "Apple_Terminal" ; then
+ if test -n "$SECURITYSESSIONID" || test -n "$TERM_PROGRAM"
+ then
browser_candidates="open $browser_candidates"
fi
# /bin/start indicates MinGW