git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug: git web--browse doesn't recognise browser on OS X

From
John Szakmeister <john@szakmeister.net>
Date
Mar 22, 2013, 17:36 UTC
Message-ID
<CAEBDL5VNodcTGBOvQjyL30qiXhshxhnUH-Vd9xy9=RxZQgH-Yw@mail.gmail.com>
In-Reply-To
<CAMxBVStVXZGGrjHzN7kukVP6_ZGo0miyJaE2FVYPVV4Jb5U82w@mail.gmail.com>
On Fri, Mar 22, 2013 at 12:19 PM, Timo Sand <timo.j.sand@gmail.com> wrote:
Show 7 quoted lines
> Hi,
>
> well my use case is actually that I'm trying to use the gem
> 'gem-browse' which uses 'git web--browse'
> I'm not using Apple Terminal, I'm using iTerm2 and there doesn't seem
> to be a SECURITYSESSIONID set, at least echo didn't find any. But
> neither did I find it on Apple Terminal either.

I noticed this the other day, but I think SECURITYSESSIONID only gets set when Screen Sharing is enabled. I had Screen Sharing enabled, launched iTerm2 and saw the variable. I closed iTerm2, turned off Screen Sharing, and relaunched iTerm2 to find the variable missing. As a result, I'm not SECURITYSESSIONID is a good mechanism for determining whether the terminal is associated a GUI or not. Unfortunately, I don't know of a better way.

> What troubles me is that this issue has only arisen recently, earlier
> this worked fine for me
The following patch fixes the issue by recognizing iTerm2 as a GUI terminal.
-John
>From 5d282325f9374b25609a8704661c252304b4d18a Mon Sep 17 00:00:00 2001
Date: Fri, 22 Mar 2013 13:23:07 -0400
Subject: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X
Signed-off-by: John Szakmeister <john@szakmeister.net>
---
 git-web--browse.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/git-web--browse.sh b/git-web--browse.sh
index 1e82726..1ff5379 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -120,6 +120,7 @@ if test -z "$browser" ; then
 	fi
 	# SECURITYSESSIONID indicates an OS X GUI login session
 	if test -n "$SECURITYSESSIONID" \
+		-o "$TERM_PROGRAM" = "iTerm.app" \
 		-o "$TERM_PROGRAM" = "Apple_Terminal" ; then
 		browser_candidates="open $browser_candidates"
 	fi
-- 
1.8.1.1
Previous: Timo SandNext: Christian Couder
Message 4 of 11 in “Fwd: Bug: git web--browse doesn't recognise browser on OS X”
  1. Timo SandMar 14, 2013
  2. Christian CouderMar 15, 2013
  3. Timo SandMar 22, 2013
  4. John SzakmeisterMar 22, 2013
  5. Christian CouderMar 24, 2013
  6. git-web--browse: recognize iTerm as a GUI terminal on OS XJohn Szakmeister, Mar 25, 2013
  7. Christian CouderMar 25, 2013
  8. Junio C HamanoMar 25, 2013
  9. John SzakmeisterMar 26, 2013
  10. Junio C HamanoMar 27, 2013
  11. John SzakmeisterApr 4, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.