You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as many others, I have one private github account, and another for work. Since github doesn't really allow easy account switching, i'm using one browser for my private stuff, and another browser for my work stuff.
This means that I need to be able to select which browser to use for gh authentication setup. It currently just opens the default browser.
My ask is that gh instead prints out the auth url, so that I can open it in the browser of my choosing. This would work much better for folks with multiple github accounts linked to different browsers.
I'm having a related issue of trying to use the tool in a headless environment (but with firefox running on the same account, elsewhere), and I set BROWSER=elinks, but the tool still just hangs there after I hit enter.
EDIT: When I set BROWSER=nonexistent it outputs the needed url. Seems to be the answer.
@ampinsk@mislav is this something we should consider, still? while we've greatly improved the auth experience at no point do we print out the URL for the browser flow unless things fail in a specific way.
I'm wondering if it's worth printing out in the "Press enter to open hostname in your browser" message instead of hostname during the browser flow.
We've decided to close this. The pain of having to manage two separate GitHub accounts is real, but after discussing internally we think the best solution right now is to rely on the BROWSER environment variable since that will select the appropriate browser for things like auth login as well as repo view -w.
An improvement that I'd welcome, however, is having a config setting for browser which could be set per host. If there's interest in that we can open an issue for it.
Activity
mislav commentedon Mar 9, 2020
Thanks for detailing your use case! You can set the BROWSER environment variable right now. Is this be a good enough workaround for you?
BROWSER='open -a Safari' gh ...xloem commentedon Apr 9, 2020
I'm having a related issue of trying to use the tool in a headless environment (but with firefox running on the same account, elsewhere), and I set
BROWSER=elinks, but the tool still just hangs there after I hit enter.EDIT: When I set
BROWSER=nonexistentit outputs the needed url. Seems to be the answer.vilmibm commentedon Aug 13, 2020
@ampinsk @mislav is this something we should consider, still? while we've greatly improved the auth experience at no point do we print out the URL for the browser flow unless things fail in a specific way.
I'm wondering if it's worth printing out in the "Press enter to open hostname in your browser" message instead of hostname during the browser flow.
ampinsk commentedon Aug 13, 2020
@vilmibm I think that would be a nice improvement!
vilmibm commentedon Aug 31, 2020
We've decided to close this. The pain of having to manage two separate GitHub accounts is real, but after discussing internally we think the best solution right now is to rely on the
BROWSERenvironment variable since that will select the appropriate browser for things likeauth loginas well asrepo view -w.An improvement that I'd welcome, however, is having a config setting for browser which could be set per host. If there's interest in that we can open an issue for it.
shibaeff commentedon Apr 23, 2026
are you guys all frontend developers and management? 90% of devops engineers work in headless setups, so this feature is a must