Console: Fix problems when using CLI from MSYS2/GitBash/ConEmu #1394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what it does
test cases
remarks about standard outputs
I renamed some of the
ConsoleOutput
functions toStandardOutput
, though only ones static to the scope oflog.cpp
for now. The terminology clarity can be helpful. The Console is very much a Microsoft Windows (MSW) term and is rarely used outside of the Windows ecosystem. Better terms are as follows:When you combine a Terminal with a Shell, you get an interactive Command Prompt we all know. You can run shells without the terminal, and you can run terminals without a shell. Windows Console is a terminal without a shell. Windows Terminal (the new UWP replacement for Console available on the Windows App Store) is also a terminal without a shell.
Anyway, whether it's a terminal or console isn't important. What is important is that it's writing to "standard output" -- this is a construct that can, at the discretion of the invoking user or process, be either:
This was all part of the rationale for me renaming 'ConsoleOutput' to 'StandardOutput'
WIN32
vs._WIN32
I used
_WIN32
to identify the Windows SDK platform. I consider the define preferable as it's a first-class buildsystem define, similar to_MSC_VER
/__clang__
/__ANDROID__
, etc. and such. By comparison,WIN32
must be manually specified by the makefile/vcxproj. In many newer project templates, I've seen the define missing entirely. My recommendation is to migrate all your instances ofWIN32
to_WIN32
at some point.