Skip to content

Commit

Permalink
touch up mintty warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
cfbao committed Jul 24, 2024
1 parent cb69b71 commit 5ad5752
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/D2L.Bmx/ConsolePrompter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,16 @@ private string GetMaskedInput( string prompt ) {
if( IS_WINDOWS ) {
// On Windows, Console.ReadKey calls native console API, and will fail without a console attached
if( Console.IsInputRedirected ) {
Console.Error.WriteLine( """
if( Environment.GetEnvironmentVariable( "TERM_PROGRAM" ) == "mintty" ) {
Console.Error.WriteLine( "\x1b[93m" + """
====== WARNING ======
Input to BMX is redirected. Input may be displayed on screen!
If you're using mintty (with Git Bash, Cygwin, MSYS2 etc.), consider switching
to Windows Terminal for a better experience.
Secret input won't be masked on screen!
This is because you are using mintty (possibly via Git Bash, Cygwin, MSYS2 etc.).
Consider switching to Windows Terminal for a better experience.
If you must use mintty, prefix your bmx command with 'winpty '.
=====================
""" );
""" + "\x1b[0m" );
}
readKey = () => (char)_stdinReader.Read();
} else {
readKey = () => Console.ReadKey( intercept: true ).KeyChar;
Expand Down

0 comments on commit 5ad5752

Please sign in to comment.