1

I've installed Git for Windows.

I want to run git-bash in a Windows Terminal tab.

I initially configured a git-bash profile, in Windows Terminal, whose Command Line field I populated with C:\Program Files\Git\git-bash.exe because I noted that the Git Bash shortcut installed by the Git Bash installer pointed to that executable.

The result of this was that when I tried to open a new git-bash tab, Windows Terminal would open the git-bash shell in a new window. I would have preferred the shell to open in a new tab, not a new window.

Various posts on Super User and Stack Overflow describe people's annoyance with the described behavior, and the common workaround seems to be to change the Command Line field to C:\Program Files\Git\bin\bash.exe instead of C:\Program Files\Git\git-bash.exe, and this works in my case as well.

My question is why does using C:\Program Files\Git\git-bash.exe result in the terminal being opened in a new window? Is there any functional difference between C:\Program Files\Git\bin\bash.exe and C:\Program Files\Git\git-bash.exe? Would I be losing anything by using the former instead of the latter?

I do no think this question is a dupe of the others because those Q&A do not discuss why this behavior is the way it is – they only mention the how of how to work around.

If there is a functional difference between bash.exe and git-bash.exe, is there any way to make git-bash.exe open in a new Windows Terminal tab instead of a new window?

Destroy666
  • 12,350
StoneThrow
  • 1,317

1 Answers1

2

Of course they are different.

git-bash.exe

git-bash.exe is a terminal executable based on mintty. I won't explain what terminal (and shell) is as the internet is full of materials about it (e.g. see this question: What is the difference between shell, console, and terminal?), I'll just shortly mention that this executable is basically aimed at providing a GUI window with options to the user. Hence a new window always opens when you launch it.

bash.exe

bash.exe is a shell executable. Its main goal is to process/interpret the commands provided by the user. It can be hooked into any terminal that supports it, including Windows Terminal.

Functional differences

Will you lose anything if you go for bash.exe? Well, you'll definitely not be able to use terminal preferences of Git Bash, if you set up any in its Options.. menu:

Options..

You will also lose any GUI capabilities that the terminal provides and that Windows Terminal doesn't. But since Windows Terminal is a more modern terminal, I doubt there'll by anything relevant for most users.

Other than that, you won't lose any functionality.

Destroy666
  • 12,350