-
Notifications
You must be signed in to change notification settings - Fork 637
More robust check for mintty when creating winpty bash aliases #664
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
base: main
Are you sure you want to change the base?
More robust check for mintty when creating winpty bash aliases #664
Conversation
Aliases cause a few issues and aren't necessary outside of mintty, so this check detects mintty but excludes Windows Terminal, VSCode terminal, and other modern windows terminals that `export TERM=xterm-256color` Signed-off-by: Andrew Bradley <cspotcode@gmail.com>
|
/updpkgsums The workflow run was started. |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
In my tests, On the other hand, in my tests, |
|
Are we talking about two different questions?
|
Correct.
Originally, all regular Console programs required Some time ago, Windows started to offer Pseudo Consoles, with the intention to provide enough functionality to make that emulated Unix pseudo terminal support obsolete. Cygwin started supporting these Pseudo Consoles, at first opt-in, then later as opt-out feature. I personally experienced so many issues with Cygwin's Pseudo Console support that I held out a lot longer than Cygwin, making the Pseudo Consoles the default in Git for Windows only much much later than Cygwin. Today, it is the default, though. Which was the reason why I tried running I also tried
So far, the only program I tried that did require was Microsoft Store's Python. I do not quite understand why that is, though. Given my understanding of Pseudo Consoles, it should work. |
winptyaliases cause some issues (see linked issue) and aren't necessary outside of mintty, so I tweaked the conditional to detect mintty and excludes Windows Terminal, VSCode terminal, and other modern windows terminals thatexport TERM=xterm-256color.git-for-windows/git#5960
Other detection techniques I considered
I considered checking
tty -sbut it returns exit code0everywhere, in both mintty and Windows Terminal. Plus, it would require access tottyon the path (usually true but maybe sometimes not?) and would mean an extra process spawn in the profile which slows down startup.I checked all env vars in both terminals, and
TERM_PROGRAMis the only one that seems viable.MSYSTEMis set in both mintty and Windows Terminal.Code review questions
Did I write the bash syntax correctly? I'm not using any bash-specific syntax that might break in unique configurations, and I'm not going to trigger errors if the shell has
set -u?