Closed AndrewRayCode closed 13 years ago
Can you try git web--browse http://google.com/
and see if that works?
That gives me The browser firefox is not available as 'firefox'.
I was able to get it to work by following the answer here:
http://stackoverflow.com/questions/4947915/how-can-i-configure-git-help-to-use-firefox
git config --global web.browser ff
git config --global browser.ff.cmd "open -a Firefox.app"
But is that the right solution?
If you're on OS X, you should probably just edit ~/.gitconfig
and
remove all traces of the browser stuff. Git on OS X defaults to
open
.
When I remove the browser lines (only lines remaining are name and email) it goes back to the original behavior. I am indeed on OS X. I wonder if I need to upgrade git, I'm using 1.7.5.3 right now
What is "the original behavior"? Take fugitive out of the question entirely until you get git web--browse
working. That Git version is plenty new enough.
With only name
and email
in my .gitconfig, running git web--browse http://google.com/
returns No known browser available.
If I add:
[web]
browser = firefox
I get The browser firefox is not available as 'firefox'.
Only when I add:
[web]
browser = ff
[browser "firefox"]
path = /Applications/Firefox.app/Contents/MacOS/firefox-bin
[browser "ff"]
cmd = open -a Firefox.app
do I see the correct behavior.
Are you just running in Terminal.app? What is the output of the following?
echo $SECURITYSESSIONID
echo $TERM_PROGRAM
no, I'm iTerm2
$ echo $SECURITYSESSIONID
$ echo $TERM_PROGRAM
iTerm.app
Edit: It works in terminal without that honkey bullshit in my gitconfig. Interesting.
Well that explains it. No idea why $SECURITYSESSIONID
would be blank though. Are you doing something weird like sshing into your own box or running in screen/tmux?
You can work around this in a much less contrived matter with git config --global web.browser open
.
Nope, I'm just running iTerm2 from spotlight. Not sshing anywhere and not using any multiplexers ... that I know about.
OK, I'm getting this behavior too. I think for different reasons. I on an Mac and have elinks installed via homebrew. Also, I have the manpageview.vim plugin installed ( https://github.com/vim-scripts/ManPageView )
git web--browse http://google.com/
opens up google in elinks
using git config --global web.browser open
is a good solution that works for me.
thanks @ivanoats, solved my issue too.
@tpope actually I'm dumb, I think iTerm2 (not regular terminal) counts as a multiplexer - letting you do splits and stuff. if I run in normal terminal the command works fine, but in iTerm2 I get the error. Your solution with open
still fixes it, but is that the right solution?
@DelvarWorld for the record, iTerm2 is my terminal of choice and I've never had an issue.
I have this exact problem too, and @ivanoats solution fixes it. Would be nice if we could pinpoint the root cause as it seems its a common problem for people running OSX and iTerm2, or at least add a warning in the README :Gbrowse section
Yeah, this issue is turning out to be surprisingly popular. @suan, can you check and see if $SECURITYSESSIONID
is set for you in Terminal.app?
@tpope It seems to be empty in both my terminal.app and iTerm2.
Googling suggests $SECURITYSESSIONID
might have been [dropped from OS X 10.6](http:// kerneltrap.org/mailarchive/git/2009/9/14/11795), but this contradicts my own experience on 10.7. What version is everyone else running?
11:40:ivan@thuja:c4c [git:master] → sw_vers
ProductName: Mac OS X
ProductVersion: 10.7.3
BuildVersion: 11D50
11:41:ivan@thuja:c4c [git:master] → uname -a
Darwin thuja 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
11:41:ivan@thuja:c4c [git:master] → echo $SECURITYSESSIONID
186b4
11:43:ivan@thuja:c4c [git:master] → echo $TERM_PROGRAM
iTerm.app
@ivanoats yours is an especially mysterious case. Looking at the source to git-web--browse
, open
gets top priority if $SECURITYSESSIONID
is set. Your sure it still uses elinks if you kill all browser config in your Git config?
You may have to throw some debug statements into git-web--browse
and see for yourself what's happening. At least you've got a solid strategy.
At least in my case, since $SECURITYSESSIONID
isn't set in either terminal.app or iTerm, but :Gbrowse
and git web--browse
works in terminal.app, the problem seems to be iTerm-specific.
I bet it doesn't work in MacVim either. Or any other 3rd party terminals. There is a workaround for Terminal.app.
I'm sure the :Gbrowse
command worked perfectly for me in iTerm2 up until recently. Now the git web--browse
simply return "No known browser available." in Iterm2. In Terminal it still works though.
By looking at the source for git web--browse
this seems to be due to $TERM_PROGRAM reporting "Apple_Terminal" in Terminal but "iTerm.app" in iTerm2. See https://github.com/git/git/blob/master/git-web--browse.sh#L121,L125.
I solved the issue in iTerm2 by running git config --global web.browser open
. I cannot explain why git web--browse
worked initially and then stopped working but I guess I'll have to live with that mystery.
Confirming that setting git config --global web.browser open
fixes the issue for me in iTerm2 and macvim when launched from iTerm2.
I just hit this issue as well after previously having no issues. Turns out, in my case, iTerm2 had actually crashed; however, was still somehow running. It wasn't until I closed the crash reporter window and restarted iTerm2 that all went back to normal.
Hope this helps someone else having this issue.
I am having same issue, when I init a initialize a repo on local and add tracking to Github branch.
One possible alternative would be to swap out git web--browse
for a call to netrw#NetrwBrowseX()
.
Supposing one cannot get the browser to open with GBlame, and the URL is not showing anywhere, is there any way to perhaps set
git config --global web.browser ff
git config --global browser.ff.cmd "open -a Firefox.app"
differently, where it would send the URL to pbcopy
or output to the status bar below vim or something? I'm perfectly content to open the browser myself as long as I can grab the URL fugitive is trying to send to git web--browse
Well it won't work now that we're using netrw, but for posterity, yes, you could do something like that if you override a browser like dillo
that doesn't take arguments.
When I installed vim using homebrew
these solved all my troubles ... doesn't seem to like the native vim version from 2010 ...thanks for help from @JamshedVesuna
I'm not sure if this is a configuraiton issue with VIM or my browser, but if I type :Gbrowse it just shows the URL on the ruler line.
I tried
git config --global web.browser firefox
and also tried chrome but I get the same result. I just cloned and that didn't fix it.