{"thread":{"id":"33178","subject":"Fwd: Bug: git web--browse doesn't recognise browser on OS X","startedAt":"2013-03-14T11:39:28Z","lastAt":"2013-04-04T00:10:10Z","messageCount":11,"participants":["Timo Sand","Christian Couder","John Szakmeister","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"211287","messageId":"CAMxBVStw-b3J_Fm9x=h3==9ebdLUkpjBSQ9-W4+zJ9N20ojfxg@mail.gmail.com","threadId":"33178","inReplyTo":"CAMxBVSs6dJFnK78E2Da7t4V9ndJFRVDZEd1fR5QuCFz=u2Bnpw@mail.gmail.com","subject":"Fwd: Bug: git web--browse doesn't recognise browser on OS X","fromName":"Timo Sand","fromEmail":"timo.j.sand@gmail.com","sentAt":"2013-03-14T11:39:28Z","receivedAt":"2013-03-14T11:39:28Z","isPatch":false,"sender":{"key":"timo.j.sand@gmail.com","avatar":null},"body":"Hi\n\nI tried to open a website by runnin 'git web--browse http://google.com'\nand it replied 'No known browser available'.\nI also tried with '--browser=chrome' and '--browser=google-chrome' but\nthe responded with 'The browser chrome is not available as 'chrome'.'\n\nI expected the command to open a new tab in my browser in each of the 3 tries.\nThis has worked for my system before.\n\nOS X 10.8.2, git 1.8.2, Google Chrome 27.0.1438.7 dev\n\n--\nTimo Sand\ntimo.j.sand+sig@gmail.com\n"},{"id":"211392","messageId":"CAP8UFD2oR5tnYuw7Nbe-CzGx7fw-OpAFW+reN+1Nroh1jXjfsQ@mail.gmail.com","threadId":"33178","inReplyTo":"CAMxBVStw-b3J_Fm9x=h3==9ebdLUkpjBSQ9-W4+zJ9N20ojfxg@mail.gmail.com","subject":"Re: Bug: git web--browse doesn't recognise browser on OS X","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-03-15T11:19:39Z","receivedAt":"2013-03-15T11:19:39Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Thu, Mar 14, 2013 at 12:39 PM, Timo Sand <timo.j.sand@gmail.com> wrote:\n> Hi\n>\n> I tried to open a website by runnin 'git web--browse http://google.com'\n> and it replied 'No known browser available'.\n\nFirst git web--browse is a plumbing shell script to display\ndocumentation on a web browser when you type something like \"git help\n-w log\".\nIt is not really supposed to be used directly by the user. On OS X it\nmight be simpler to just type \"open http://google.com\".\n\nThat said there is the following in it to make it work on OS X:\n\n# SECURITYSESSIONID indicates an OS X GUI login session\nif test -n \"$SECURITYSESSIONID\" \\\n-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" ; then\nbrowser_candidates=\"open $browser_candidates\"\nfi\n\nSo I guess that you don't have SECURITYSESSIONID set in your terminal\nand you are not using Apple Terminal.\n\nAs I am not using OS X, I have no idea how to improve the script in this case.\n\n> I also tried with '--browser=chrome' and '--browser=google-chrome' but\n> the responded with 'The browser chrome is not available as 'chrome'.'\n\nCould you try something like: \"chromium http://google.com\" or\n\"chromium-browser http://google.com\"\nIf it works, then using 'git web--browse' with '--browser=chromium' or\n'--browser=chromium-browser' should work.\n\nOtherwise did you try \"chrome http://google.com\" and \"google-chrome\nhttp://google.com\"?\n\n> I expected the command to open a new tab in my browser in each of the 3 tries.\n> This has worked for my system before.\n>\n> OS X 10.8.2, git 1.8.2, Google Chrome 27.0.1438.7 dev\n\nThanks,\nChristian.\n"},{"id":"211954","messageId":"CAMxBVStVXZGGrjHzN7kukVP6_ZGo0miyJaE2FVYPVV4Jb5U82w@mail.gmail.com","threadId":"33178","inReplyTo":"CAP8UFD2oR5tnYuw7Nbe-CzGx7fw-OpAFW+reN+1Nroh1jXjfsQ@mail.gmail.com","subject":"Re: Bug: git web--browse doesn't recognise browser on OS X","fromName":"Timo Sand","fromEmail":"timo.j.sand@gmail.com","sentAt":"2013-03-22T16:19:05Z","receivedAt":"2013-03-22T16:19:05Z","isPatch":false,"sender":{"key":"timo.j.sand@gmail.com","avatar":null},"body":"Hi,\n\nwell my use case is actually that I'm trying to use the gem\n'gem-browse' which uses 'git web--browse'\nI'm not using Apple Terminal, I'm using iTerm2 and there doesn't seem\nto be a SECURITYSESSIONID set, at least echo didn't find any. But\nneither did I find it on Apple Terminal either.\n\nWhat troubles me is that this issue has only arisen recently, earlier\nthis worked fine for me\n\nOn 15 March 2013 11:19, Christian Couder <christian.couder@gmail.com> wrote:\n> Hi,\n>\n> On Thu, Mar 14, 2013 at 12:39 PM, Timo Sand <timo.j.sand@gmail.com> wrote:\n>> Hi\n>>\n>> I tried to open a website by runnin 'git web--browse http://google.com'\n>> and it replied 'No known browser available'.\n>\n> First git web--browse is a plumbing shell script to display\n> documentation on a web browser when you type something like \"git help\n> -w log\".\n> It is not really supposed to be used directly by the user. On OS X it\n> might be simpler to just type \"open http://google.com\".\n>\n> That said there is the following in it to make it work on OS X:\n>\n> # SECURITYSESSIONID indicates an OS X GUI login session\n> if test -n \"$SECURITYSESSIONID\" \\\n> -o \"$TERM_PROGRAM\" = \"Apple_Terminal\" ; then\n> browser_candidates=\"open $browser_candidates\"\n> fi\n>\n> So I guess that you don't have SECURITYSESSIONID set in your terminal\n> and you are not using Apple Terminal.\n>\n> As I am not using OS X, I have no idea how to improve the script in this case.\n>\n>> I also tried with '--browser=chrome' and '--browser=google-chrome' but\n>> the responded with 'The browser chrome is not available as 'chrome'.'\n>\n> Could you try something like: \"chromium http://google.com\" or\n> \"chromium-browser http://google.com\"\n> If it works, then using 'git web--browse' with '--browser=chromium' or\n> '--browser=chromium-browser' should work.\n>\n> Otherwise did you try \"chrome http://google.com\" and \"google-chrome\n> http://google.com\"?\n>\n>> I expected the command to open a new tab in my browser in each of the 3 tries.\n>> This has worked for my system before.\n>>\n>> OS X 10.8.2, git 1.8.2, Google Chrome 27.0.1438.7 dev\n>\n> Thanks,\n> Christian.\n\n\n\n-- \nTimo Sand\ntimo.j.sand+sig@gmail.com\n"},{"id":"211962","messageId":"CAEBDL5VNodcTGBOvQjyL30qiXhshxhnUH-Vd9xy9=RxZQgH-Yw@mail.gmail.com","threadId":"33178","inReplyTo":"CAMxBVStVXZGGrjHzN7kukVP6_ZGo0miyJaE2FVYPVV4Jb5U82w@mail.gmail.com","subject":"Re: Bug: git web--browse doesn't recognise browser on OS X","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2013-03-22T17:36:04Z","receivedAt":"2013-03-22T17:36:04Z","isPatch":false,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"On Fri, Mar 22, 2013 at 12:19 PM, Timo Sand <timo.j.sand@gmail.com> wrote:\n> Hi,\n>\n> well my use case is actually that I'm trying to use the gem\n> 'gem-browse' which uses 'git web--browse'\n> I'm not using Apple Terminal, I'm using iTerm2 and there doesn't seem\n> to be a SECURITYSESSIONID set, at least echo didn't find any. But\n> neither did I find it on Apple Terminal either.\n\nI noticed this the other day, but I think SECURITYSESSIONID only gets\nset when Screen Sharing is enabled.  I had Screen Sharing enabled,\nlaunched iTerm2 and saw the variable.  I closed iTerm2, turned off\nScreen Sharing, and relaunched iTerm2 to find the variable missing.\nAs a result, I'm not SECURITYSESSIONID is a good mechanism for\ndetermining whether the terminal is associated a GUI or not.\nUnfortunately, I don't know of a better way.\n\n> What troubles me is that this issue has only arisen recently, earlier\n> this worked fine for me\n\nThe following patch fixes the issue by recognizing iTerm2 as a GUI terminal.\n\n-John\n\n>From 5d282325f9374b25609a8704661c252304b4d18a Mon Sep 17 00:00:00 2001\nDate: Fri, 22 Mar 2013 13:23:07 -0400\nSubject: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X\n\nSigned-off-by: John Szakmeister <john@szakmeister.net>\n---\n git-web--browse.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 1e82726..1ff5379 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -120,6 +120,7 @@ if test -z \"$browser\" ; then\n \tfi\n \t# SECURITYSESSIONID indicates an OS X GUI login session\n \tif test -n \"$SECURITYSESSIONID\" \\\n+\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" \\\n \t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" ; then\n \t\tbrowser_candidates=\"open $browser_candidates\"\n \tfi\n-- \n1.8.1.1\n"},{"id":"212116","messageId":"CAP8UFD2m8n5RHN-CgyDP1ir_AorpJGnWwNhXuRxDa=DbHfsdiw@mail.gmail.com","threadId":"33178","inReplyTo":"CAEBDL5VNodcTGBOvQjyL30qiXhshxhnUH-Vd9xy9=RxZQgH-Yw@mail.gmail.com","subject":"Re: Bug: git web--browse doesn't recognise browser on OS X","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-03-24T21:05:53Z","receivedAt":"2013-03-24T21:05:53Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Fri, Mar 22, 2013 at 6:36 PM, John Szakmeister <john@szakmeister.net> wrote:\n> On Fri, Mar 22, 2013 at 12:19 PM, Timo Sand <timo.j.sand@gmail.com> wrote:\n>> Hi,\n>>\n>> well my use case is actually that I'm trying to use the gem\n>> 'gem-browse' which uses 'git web--browse'\n>> I'm not using Apple Terminal, I'm using iTerm2 and there doesn't seem\n>> to be a SECURITYSESSIONID set, at least echo didn't find any. But\n>> neither did I find it on Apple Terminal either.\n>\n> I noticed this the other day, but I think SECURITYSESSIONID only gets\n> set when Screen Sharing is enabled.  I had Screen Sharing enabled,\n> launched iTerm2 and saw the variable.  I closed iTerm2, turned off\n> Screen Sharing, and relaunched iTerm2 to find the variable missing.\n> As a result, I'm not SECURITYSESSIONID is a good mechanism for\n> determining whether the terminal is associated a GUI or not.\n> Unfortunately, I don't know of a better way.\n>\n>> What troubles me is that this issue has only arisen recently, earlier\n>> this worked fine for me\n>\n> The following patch fixes the issue by recognizing iTerm2 as a GUI terminal.\n\nYour patch looks good to me, and I cannot really test it as I don't have a Mac.\nCould you just had some of the explanations you gave above to the\ncommit message?\n\nThanks,\nChristian.\n"},{"id":"212156","messageId":"20130325101318.GA31409@yoda.local","threadId":"33178","inReplyTo":"CAP8UFD2m8n5RHN-CgyDP1ir_AorpJGnWwNhXuRxDa=DbHfsdiw@mail.gmail.com","subject":"[PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2013-03-25T10:13:18Z","receivedAt":"2013-03-25T10:13:18Z","isPatch":true,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"It turns out that the presence of SECURITYSESSIONID is not sufficient\nfor detecting the presence of a GUI under Mac OS X.  SECURITYSESSIONID\nappears to only be set when the user has Screen Sharing enabled.\nDisabling Screen Sharing and relaunching the shell showed that the\nvariable was missing, at least under Mac OS X 10.6.8.  As a result,\nlet's check for iTerm directly via TERM_PROGRAM.\n\nSigned-off-by: John Szakmeister <john@szakmeister.net>\n---\n\nOn Sun, Mar 24, 2013 at 10:05:53PM +0100, Christian Couder wrote:\n[snip]\n> Your patch looks good to me, and I cannot really test it as I don't have a Mac.\n> Could you just had some of the explanations you gave above to the\n> commit message?\n\nHere's an updated patch.  I also noticed that git-bisect.sh is\nalso trying to determine if a GUI is present by looking for\nSECURITYSESSIONID as well.  I wonder if it would be better to\ncreate a shell function in git-sh-setup.sh that the two scripts\ncould use?\n\n-John\n\ngit-web--browse.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 1e82726..1ff5379 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -120,6 +120,7 @@ if test -z \"$browser\" ; then\n \tfi\n \t# SECURITYSESSIONID indicates an OS X GUI login session\n \tif test -n \"$SECURITYSESSIONID\" \\\n+\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" \\\n \t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" ; then\n \t\tbrowser_candidates=\"open $browser_candidates\"\n \tfi\n-- \n1.8.2\n"},{"id":"212209","messageId":"CAP8UFD21BChC-KF+HWWS9_q_GtpGm+Uh_L60qcJt=b3mQt_jBw@mail.gmail.com","threadId":"33178","inReplyTo":"20130325101318.GA31409@yoda.local","subject":"Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-03-25T20:13:01Z","receivedAt":"2013-03-25T20:13:01Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Mar 25, 2013 at 11:13 AM, John Szakmeister <john@szakmeister.net> wrote:\n>\n> Here's an updated patch.\n\nThank you for it. For what it's worth:\n\nAcked-by: Christian Couder <chriscool@tuxfamily.org>\n\n> I also noticed that git-bisect.sh is\n> also trying to determine if a GUI is present by looking for\n> SECURITYSESSIONID as well.  I wonder if it would be better to\n> create a shell function in git-sh-setup.sh that the two scripts\n> could use?\n\nYeah, it might be a good idea to have some common functions to\ndetermine if a GUI is present.\nMaybe you could start with an os_x_gui_present() function in another\npatch on top of this one.\n\nThanks,\nChristian.\n"},{"id":"212232","messageId":"7vtxnzw3wu.fsf@alter.siamese.dyndns.org","threadId":"33178","inReplyTo":"20130325101318.GA31409@yoda.local","subject":"Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-25T21:44:17Z","receivedAt":"2013-03-25T21:44:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Szakmeister <john@szakmeister.net> writes:\n\n> It turns out that the presence of SECURITYSESSIONID is not sufficient\n> for detecting the presence of a GUI under Mac OS X.  SECURITYSESSIONID\n> appears to only be set when the user has Screen Sharing enabled.\n> Disabling Screen Sharing and relaunching the shell showed that the\n> variable was missing, at least under Mac OS X 10.6.8.  As a result,\n> let's check for iTerm directly via TERM_PROGRAM.\n>\n> Signed-off-by: John Szakmeister <john@szakmeister.net>\n> ---\n>\n> On Sun, Mar 24, 2013 at 10:05:53PM +0100, Christian Couder wrote:\n> [snip]\n>> Your patch looks good to me, and I cannot really test it as I don't have a Mac.\n>> Could you just had some of the explanations you gave above to the\n>> commit message?\n>\n> Here's an updated patch.  I also noticed that git-bisect.sh is\n> also trying to determine if a GUI is present by looking for\n> SECURITYSESSIONID as well.  I wonder if it would be better to\n> create a shell function in git-sh-setup.sh that the two scripts\n> could use?\n\nYes, but that can come later once this settles.\n\nYour patch makes me wonder if\n\n\ttest -n \"$TERM_PROGRAM\"\n\nwithout any SECURITYSESSIONID or explicit program name checks should\nsuffice, though.\n\n>\n> -John\n>\n> git-web--browse.sh | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/git-web--browse.sh b/git-web--browse.sh\n> index 1e82726..1ff5379 100755\n> --- a/git-web--browse.sh\n> +++ b/git-web--browse.sh\n> @@ -120,6 +120,7 @@ if test -z \"$browser\" ; then\n>  \tfi\n>  \t# SECURITYSESSIONID indicates an OS X GUI login session\n>  \tif test -n \"$SECURITYSESSIONID\" \\\n> +\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" \\\n>  \t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" ; then\n>  \t\tbrowser_candidates=\"open $browser_candidates\"\n>  \tfi\n"},{"id":"212273","messageId":"CAEBDL5Vx0vjAKUeFrXgpx7mYxk8B+OQC5yrEii9RMP-5-Sjhsw@mail.gmail.com","threadId":"33178","inReplyTo":"7vtxnzw3wu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2013-03-26T08:54:42Z","receivedAt":"2013-03-26T08:54:42Z","isPatch":true,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"Sorry about the repeat Junio, I meant to hit \"Reply to All\".\n\nOn Mon, Mar 25, 2013 at 5:44 PM, Junio C Hamano <gitster@pobox.com> wrote:\n[snip]\n> Your patch makes me wonder if\n>\n>         test -n \"$TERM_PROGRAM\"\n>\n> without any SECURITYSESSIONID or explicit program name checks should\n> suffice, though.\n\nSo, after downloading a couple of other terminals and trying things\nout, I think you're suggestion does suffice.  Should I send an updated\npatch?\n\n-John\n"},{"id":"212379","messageId":"7vfvzgrjgz.fsf@alter.siamese.dyndns.org","threadId":"33178","inReplyTo":"CAEBDL5Vx0vjAKUeFrXgpx7mYxk8B+OQC5yrEii9RMP-5-Sjhsw@mail.gmail.com","subject":"Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-27T14:43:56Z","receivedAt":"2013-03-27T14:43:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Szakmeister <john@szakmeister.net> writes:\n\n> Sorry about the repeat Junio, I meant to hit \"Reply to All\".\n>\n> On Mon, Mar 25, 2013 at 5:44 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> [snip]\n>> Your patch makes me wonder if\n>>\n>>         test -n \"$TERM_PROGRAM\"\n>>\n>> without any SECURITYSESSIONID or explicit program name checks should\n>> suffice, though.\n>\n> So, after downloading a couple of other terminals and trying things\n> out, I think you're suggestion does suffice.  Should I send an updated\n> patch?\n\nIf that approach is better than what you originally sent, then yes.\n\nBut I do not use OS X, so you may need to pay attention to possible\ncomplaints and comments from other Mac users on this list for a\nwhile---there may be people who run the program in question without\nthat environment variable.\n"},{"id":"213076","messageId":"CAEBDL5WEChOgG2XVML=tjWtUgp4_5nQq-KqQv-h79tgaDTx9bA@mail.gmail.com","threadId":"33178","inReplyTo":"7vfvzgrjgz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-web--browse: recognize iTerm as a GUI terminal on OS X","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2013-04-04T00:10:10Z","receivedAt":"2013-04-04T00:10:10Z","isPatch":true,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"On Wed, Mar 27, 2013 at 10:43 AM, Junio C Hamano <gitster@pobox.com> wrote:\n[snip]\n> If that approach is better than what you originally sent, then yes.\n>\n> But I do not use OS X, so you may need to pay attention to possible\n> complaints and comments from other Mac users on this list for a\n> while---there may be people who run the program in question without\n> that environment variable.\n\nSorry it has taken me so long to get back to this.  I searched around\nand tried out a few terminal programs that are available, and I think\nwhat you queued--checking that TERM_PROGRAM is non-empty--is the right\nfix.\n\nThanks!\n\n-John\n"}]}