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

Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2013, 21:44 UTC
Message-ID
<7vtxnzw3wu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130325101318.GA31409@yoda.local>
John Szakmeister <john@szakmeister.net> writes:
Show 21 quoted lines
> 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.  As a result,
> let's check for iTerm directly via TERM_PROGRAM.
>
> Signed-off-by: John Szakmeister <john@szakmeister.net>
> ---
>
> On Sun, Mar 24, 2013 at 10:05:53PM +0100, Christian Couder wrote:
> [snip]
>> Your patch looks good to me, and I cannot really test it as I don't have a Mac.
>> Could you just had some of the explanations you gave above to the
>> commit message?
>
> Here's an updated patch.  I also noticed that git-bisect.sh is
> also trying to determine if a GUI is present by looking for
> SECURITYSESSIONID as well.  I wonder if it would be better to
> create a shell function in git-sh-setup.sh that the two scripts
> could use?
Yes, but that can come later once this settles.
Your patch makes me wonder if
	test -n "$TERM_PROGRAM"

without any SECURITYSESSIONID or explicit program name checks should suffice, though.

Show 18 quoted lines
>
> -John
>
> 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
Previous: Christian CouderNext: John Szakmeister
Message 8 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.