aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-10-16 00:35:47 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-10-16 00:35:47 -0700
commit56e1d2f6961693b45f2b61b6e6985229be56e674 (patch)
tree2aded58aa0c6db7e09496d07acff62f5ec29e380 /toolsrc/src/vcpkg.cpp
parent5d0b56d7c1b30709a4fc6c7899ef01781ee155e6 (diff)
downloadvcpkg-56e1d2f6961693b45f2b61b6e6985229be56e674.tar.gz
vcpkg-56e1d2f6961693b45f2b61b6e6985229be56e674.zip
[vcpkg] Wrap all external process spawning in a Ctrl-C catcher to avoid corrupted consoles
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 6f10c503d..ba9710562 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -261,6 +261,7 @@ int main(const int argc, const char* const* const argv)
#if defined(_WIN32)
GlobalState::g_init_console_cp = GetConsoleCP();
GlobalState::g_init_console_output_cp = GetConsoleOutputCP();
+ GlobalState::g_init_console_initialized = true;
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
@@ -275,6 +276,9 @@ int main(const int argc, const char* const* const argv)
locked_metrics->track_property("cmdline", trimmed_command_line);
#endif
}
+
+ Checks::register_console_ctrl_handler();
+
load_config();
const auto vcpkg_feature_flags_env = System::get_environment_variable("VCPKG_FEATURE_FLAGS");
@@ -293,8 +297,6 @@ int main(const int argc, const char* const* const argv)
if (const auto p = args.sendmetrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p);
if (const auto p = args.debug.get()) GlobalState::debugging = *p;
- Checks::register_console_ctrl_handler();
-
if (GlobalState::debugging)
{
inner(args);