{"thread":{"id":"31647","subject":"[PATCH] git-web--browse: Fix open HTML help pages from iTerm","startedAt":"2012-09-25T18:16:43Z","lastAt":"2012-09-27T19:31:51Z","messageCount":3,"participants":["Steffen Prohaska","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"199903","messageId":"1348597003-28403-1-git-send-email-prohaska@zib.de","threadId":"31647","inReplyTo":null,"subject":"[PATCH] git-web--browse: Fix open HTML help pages from iTerm","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2012-09-25T18:16:43Z","receivedAt":"2012-09-25T18:16:43Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"iTerm is an alternative to the default terminal emulation program on Mac\nOS X.  git-web--browse wasn't aware of iTerm and failed to open HTML\nhelp pages when used in a shell session running in iTerm, reporting \"No\nknown browser available.\"  Now it works as expected.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-web--browse.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 1e82726..95ecf65 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -120,7 +120,8 @@ 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\" = \"Apple_Terminal\" ; then\n+\t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" \\\n+\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" ; then\n \t\tbrowser_candidates=\"open $browser_candidates\"\n \tfi\n \t# /bin/start indicates MinGW\n-- \n1.7.12.1.403.g14e83b4\n"},{"id":"200038","messageId":"7v3923qo0n.fsf@alter.siamese.dyndns.org","threadId":"31647","inReplyTo":"1348597003-28403-1-git-send-email-prohaska@zib.de","subject":"Re: [PATCH] git-web--browse: Fix open HTML help pages from iTerm","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T19:11:36Z","receivedAt":"2012-09-27T19:11:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> writes:\n\n> iTerm is an alternative to the default terminal emulation program on Mac\n> OS X.  git-web--browse wasn't aware of iTerm and failed to open HTML\n> help pages when used in a shell session running in iTerm, reporting \"No\n> known browser available.\"  Now it works as expected.\n>\n> Signed-off-by: Steffen Prohaska <prohaska@zib.de>\n> ---\n>  git-web--browse.sh | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-web--browse.sh b/git-web--browse.sh\n> index 1e82726..95ecf65 100755\n> --- a/git-web--browse.sh\n> +++ b/git-web--browse.sh\n> @@ -120,7 +120,8 @@ 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\" = \"Apple_Terminal\" ; then\n> +\t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" \\\n> +\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" ; then\n>  \t\tbrowser_candidates=\"open $browser_candidates\"\n>  \tfi\n\nI do not have anything against iTerm, but could we have a solution\nthat does not force us to keep adding 47 different terminal program\nnames to the list over the longer term (no pun intended)?  For\nexample, \"If on OS-X (which by the way does not seem to be checked\nwith the current logic) and environment TERM_PROGRAM is set to any\nvalue\", or something.\n"},{"id":"200040","messageId":"0D4FA057-D2C1-4235-961F-166FD9DCA4F4@zib.de","threadId":"31647","inReplyTo":"7v3923qo0n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-web--browse: Fix open HTML help pages from iTerm","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2012-09-27T19:31:51Z","receivedAt":"2012-09-27T19:31:51Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Sep 27, 2012, at 9:11 PM, Junio C Hamano wrote:\n\n> Steffen Prohaska <prohaska@zib.de> writes:\n> \n>> iTerm is an alternative to the default terminal emulation program on Mac\n>> OS X.  git-web--browse wasn't aware of iTerm and failed to open HTML\n>> help pages when used in a shell session running in iTerm, reporting \"No\n>> known browser available.\"  Now it works as expected.\n>> \n>> Signed-off-by: Steffen Prohaska <prohaska@zib.de>\n>> ---\n>> git-web--browse.sh | 3 ++-\n>> 1 file changed, 2 insertions(+), 1 deletion(-)\n>> \n>> diff --git a/git-web--browse.sh b/git-web--browse.sh\n>> index 1e82726..95ecf65 100755\n>> --- a/git-web--browse.sh\n>> +++ b/git-web--browse.sh\n>> @@ -120,7 +120,8 @@ 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\" = \"Apple_Terminal\" ; then\n>> +\t\t-o \"$TERM_PROGRAM\" = \"Apple_Terminal\" \\\n>> +\t\t-o \"$TERM_PROGRAM\" = \"iTerm.app\" ; then\n>> \t\tbrowser_candidates=\"open $browser_candidates\"\n>> \tfi\n> \n> I do not have anything against iTerm, but could we have a solution\n> that does not force us to keep adding 47 different terminal program\n> names to the list over the longer term (no pun intended)?  For\n> example, \"If on OS-X (which by the way does not seem to be checked\n> with the current logic) and environment TERM_PROGRAM is set to any\n> value\", or something.\n\nI googled a bit and it seems that TERM_PROGRAM is specific to OS X.\nSo simply testing whether TERM_PROGRAM is set to any value (without\nadditional check for OS X) might be good enough.\n\nI am wondering whether anyone knows if TERM_PROGRAM is used on other\noperating systems besides OS X.\n\n\tSteffen\n"}]}