-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upon installation, add a Git Bash profile, if Git for Windows is present #1394
Comments
Tried to manually add but it opens in a separate window. Not sure if is compatible |
If you are launching “mintty,” or if git bash is using “mintty,” it will launch in a separate window. We can’t fix that: they’ve chosen to launch their own terminal emulator. |
The "trick" is that you must no run |
Specifically, use this JSON fragment to open Git Bash (if it's installed in the default location): "commandline" : "C:\\Program Files\\Git\\bin\\bash.exe",
"icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name" : "Git Bash",
"startingDirectory" : "%HOMEDRIVE%%HOMEPATH%" |
I also tried and see the same... it opens the git-bash.exe as a separate window |
Good thing somebody responded with the actual fix :) |
Issue extension and suggested name: Scan installed shell interpreters on Terminal first run/install and initial profiles.json generation Scanning PATH for known shells at their default install locations. If a shell is present, add it (along with any custom fixes such as the Ideally (for this manually edited my profiles.json, but the intent is to have shells automatically detected) : |
Note that, strictly speaking, scanning PATH is not enough, as esp. Git for Windows often is not in the system PATH. Instead, Git for Windows (or shells in general) should be discovered by looking at the registry like I had proposed above. At the concrete example of Git for Windows the registry key to look at is |
use bin\bash.exe instead of git-bash.exe |
I'm actually going to re-open this to make sure that it gets done once #754 is complete. |
Here is a code snippet of my config file that has it loading in the terminal. Thanks to everyone who contributed to the solution. I'm using a custom icon, so it won't be in your path.
|
Just to add some notes I found (about the actual bash.exe path to use and startup parameters to launch a login shell): |
For posterity - this should be using "%PROGRAMFILES%\Git\bin\bash.exe", not "%PROGRAMFILES%\Git\usr\bin\bash.exe". The latter doesn't seem to fully initialize the environment for bash (e.g. https://stackoverflow.com/questions/56839307/adding-git-bash-to-the-new-windows-terminal#comment110596050_57369284 ... also, compare the results of "uname -s" between a stock git bash outside of Terminal and what you get in Terminal when referencing the above two executables. In my case, only "Git\bin\bash.exe" gives the "correct" result of MINGW64_T. The latter gives MSYS_NT.) |
Btw. there's a reverse of this issue open at Git for Windows#3183 with a matching Pull Request already open and being worked on. |
The Git for Windows PR was merged, and Git for Windows v2.32.0-rc1 (or the next snapshot) will have this option. |
That's awesome to hear! I guess I can close this then! /dup git-for-windows/git#3183 |
Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report! |
Summary of the new feature/enhancement
When installing the terminal for the first time, it would be nice if a profile for Bash from Git for Windows would be automatically provided if Git for Windows is installed.
Proposed technical implementation details (optional)
Auto-detect via installer registry keys whether Git for Windows in installed, and if so, add an entry to
profiles.json
to run Bash from Git for Windows in the terminal app.The text was updated successfully, but these errors were encountered: