All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Szakmeister <john@szakmeister.net>
Cc: Christian Couder <christian.couder@gmail.com>,
	Timo Sand <timo.j.sand@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X
Date: Mon, 25 Mar 2013 14:44:17 -0700	[thread overview]
Message-ID: <7vtxnzw3wu.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130325101318.GA31409@yoda.local> (John Szakmeister's message of "Mon, 25 Mar 2013 06:13:18 -0400")

John Szakmeister <john@szakmeister.net> writes:

> 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.

>
> -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

  parent reply	other threads:[~2013-03-25 21:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMxBVSs6dJFnK78E2Da7t4V9ndJFRVDZEd1fR5QuCFz=u2Bnpw@mail.gmail.com>
2013-03-14 11:39 ` Fwd: Bug: git web--browse doesn't recognise browser on OS X Timo Sand
2013-03-15 11:19   ` Christian Couder
2013-03-22 16:19     ` Timo Sand
2013-03-22 17:36       ` John Szakmeister
2013-03-24 21:05         ` Christian Couder
2013-03-25 10:13           ` [PATCH] git-web--browse: recognize iTerm as a GUI terminal " John Szakmeister
2013-03-25 20:13             ` Christian Couder
2013-03-25 21:44             ` Junio C Hamano [this message]
2013-03-26  8:54               ` John Szakmeister
2013-03-27 14:43                 ` Junio C Hamano
2013-04-04  0:10                   ` John Szakmeister

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtxnzw3wu.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=john@szakmeister.net \
    --cc=timo.j.sand@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.