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
The Git-for-windows installer should create an shortcut icon for bash.exe #3689
Comments
It's (as always) more complicated than that. Git Bash doesn't need to run using mintty, it can also run using Conhost.
If you're on a recent build of Windows 10, not terribly much. If you're on an old build of Windows 10 or an even older version of Windows, everything. Microsoft has improved Conhost a lot in recent years, but we're still supporting versions going back to Vista and our support for new Conhost features like ConPTY is still experimental. Once that becomes stable we might consider flipping the default to Conhost on fresh installs on new Builds of Windows 10.
Because we don't want people calling that executable directly. Its existence is an implementation detail. There's slightly more to |
There is an option in Git for Windows' installer to use ConHost instead of MinTTY. That should address your concern. Having two Git Bash shortcuts -- one that uses MinTTY, the other ConHost -- would simply be too confusing. |
People typically encounter this problem a long time after they installed Git Bash. Maybe it was installed by someone else, e.g. a lab administrator or a developer SDK. Our current solution looks like this:
It sounds like you're proposing that we add an item:
Whereas I'm asking for a simpler world where we can say:
|
I noticed that the Git Bash shortcut invokes Something like:
|
Directly in |
Setup
defaults?
Details
The problem
There is a longstanding known issue where Git Bash's TTY gets lost when STDIN is passed to a shell command on Windows. This breaks programs that want to interactively prompt for terminal input.
Examples of people who encountered this problem over the years:
yarn upgrade-interactive
: yarnpkg/yarn#4497The status quo
The commonly recommended workaround is to use the
winpty
wrapper for EVERY such shell command. Instead ofrush setup
, we must dowinpty rush.cmd setup
. Instead ofyarn upgrade-interactive
, we must dowinpty yarn.cmd upgrade-interactive
. And so forth.This works but is obviously very clumsy.
A better solution
It turns out that Git provides two Bash binaries:
C:\Program Files\Git\git-bash.exe
- This is what gets launched by the Git Bash shortcut icon. It requireswinpty
because its terminal is themintty.exe
from MinGW. (A GUI app that does custom font rendering.)C:\Program Files\Git\bin\bash.exe
- This is a conventional Windows console app (with Microsoft fonts), which opens a Win32 terminal, and therefore its TTY is compatible with other Windows console apps likenode.exe
.Thus, a really great workaround is to drag+drop
C:\Program Files\Git\bin\bash.exe
onto your Windows desktop, and create a shortcut icon for it. That will open a nice Bash terminal with no need forwinpty
. This seems like a much better workaround. 👍👍Questions:
bash.exe
? (For example maybe there could be two icons,Git Bash - MinTTY
andGit Bash - Terminal
?)bash.exe
be the preferred default experience for people who are wanting to use Bash on Windows? What's so preferable aboutmintty.exe
?The text was updated successfully, but these errors were encountered: