Skip to contentSkip to conversation

web--browse: fix Mac OS X GUI detection for 10.6

PATCH New Heiko Voigt 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 web--browse: fix Mac OS X GUI detection for 10.6

Since OS X 10.6 the variable $SECURITYSESSIONID does not exist anymore, so lets look for the $TERM_PROGRAM variable as backup.

---
 git-web--browse.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
git-web--browse.sh +2 -1
index 4f5c740..a578c3a 100755
@@ -111,7 +111,8 @@ if test -z "$browser" ; then
 	browser_candidates="w3m links lynx"
     fi
     # SECURITYSESSIONID indicates an OS X GUI login session
-    if test -n "$SECURITYSESSIONID"; then
+    if test -n "$SECURITYSESSIONID" \
+	    -o "$TERM_PROGRAM" = "Apple_Terminal" ; then
 	browser_candidates="open $browser_candidates"
     fi
     # /bin/start indicates MinGW
Signature · 1 line
1.6.5.rc1.dirty