How to wrap the bash shell from Github for Windows in Console2?
Asked Answered
U

1

14

I'm trying to get the bash shell of Github for Windows to be wrapped by Console2. This is not as easy as I'd hoped. This is super easy with Git for Windows from git-scm.com. I know that I can use that bash shell with Console2 no problem and have been, I'm just really curious about how to do this with the Github for Windows bash shell. With the name similarity between Github for Windows and Git for Windows, I have been thwarted in my searching for a solution. enter image description here

Wrapping the bash shell from the git-scm.com mysysgit aka Git for Windows is very simple since it comes with a sh.exe. You simply fill the Shell: field in Console2 settings with something like:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i

enter image description here

My question is how do you get the Github for Windows bash shell to open inside of Console2?

In Github for windows, there is no easy path and executable for the Shell field. What you can do is go into the options for Github for Windows and set a custom program and have that point to Console2 like so: enter image description here

The real trick is what goes into Console2 settings? What goes into the Shell: field to get a the bash shell inside Console2? If you look at the target of the shell command for Github for Windows with the bash shell selected, you get something a little strange:

C:\Users\10136196\AppData\Local\GitHub\GitHub.appref-ms --open-shell

This has to do with microsoft one click install functionality that Github for Windows uses and this will not work in the Console2 settings Shell: field in my experimentation.

Uptotheminute answered 30/4, 2014 at 20:14 Comment(0)
U
19

I sought out help directly from Github for Windows. I received a very prompt response with a solution that works.

There are 2 steps:

1) Set the Github for Windows options for default shell to Custom and put the path and executable for the Console.exe. I was already doing this and there are screenshots in the question above. (Make sure you hit that update button to save your changes)

2) In the Console2 'Shell' text box in the 'Tabs' section you'll need to put this:

bash.exe --login -i

No path required, just the executable named bash.exe (this is magic to me). The Console Settings should look like this:

enter image description here

A couple of gotchas... I was advised to leave the Startup Directory blank in the Console 2 settings (I think this is so that the startup directory in Gitub for Windows GUI is honored) and that the Github for Windows tab should be the first in the listing of tabs. Another gotcha I discovered is that you can no longer use the Console.exe directly to start up your shell. You must use the Github for Windows shell shortcut that gets installed.
enter image description here

Otherwise you will get an error that says, "Unable to start bash.exe --login -i!"

Uptotheminute answered 1/5, 2014 at 13:58 Comment(1)
Explanation of the "magic": bash.exe's location may be defined in your PATH variables, which is why it can resolve it without the full path. Thanks for the answer :)Sphericity

© 2022 - 2024 — McMap. All rights reserved.