Fix the cmake's output for vcpkg_get_dep_info()
* Fix the cmake's output for vcpkg_get_dep_info()
Set CLICOLOR=0 to force cmake to output "plain" text (without ANSI escape codes)
* Adding a reference link
Should explain the logic behind CLICOLOR and CLICOLOR_FORCE
* Expand the comment
* clang-format
MODIFY
src/vcpkg.cpp
src/vcpkg.cpp
@@ -186,7 +186,16 @@ int main(const int argc, const char* const* const argv)
}
#endif
set_environment_variable("VCPKG_COMMAND", get_exe_path_of_current_process().generic_u8string());
+
+ // Prevent child processes (ex. cmake) from producing "colorized"
+ // output (which may include ANSI escape codes), since it would
+ // complicate parsing the output.
+ //
+ // See http://bixense.com/clicolors for the semantics associated with
+ // the CLICOLOR and CLICOLOR_FORCE env variables
+ //
set_environment_variable("CLICOLOR_FORCE", {});
+ set_environment_variable("CLICOLOR", "0");
Checks::register_global_shutdown_handler([]() {
const auto elapsed_us_inner = GlobalState::timer.microseconds();

Fix the cmake's output for vcpkg_get_dep_info() (#290)

* Fix the cmake's output for vcpkg_get_dep_info()

Set CLICOLOR=0 to force cmake to output "plain" text (without ANSI escape codes)

* Adding a reference link

Should explain the logic behind CLICOLOR and CLICOLOR_FORCE

* Expand the comment

* clang-format

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>