From b42695a0b5e6dec92fe86b8a7f40ec0d0b7c8db7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 10 Dec 2015 14:37:09 +0800 Subject: [PATCH] win: Don't attach console for third party terms Close #3692. --- atom/app/atom_main.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/atom/app/atom_main.cc b/atom/app/atom_main.cc index 5b5df44..1ffab8d 100644 --- a/atom/app/atom_main.cc +++ b/atom/app/atom_main.cc @@ -7,10 +7,6 @@ #include #if defined(OS_WIN) -#include -#include -#include - #include #include #include @@ -56,12 +52,6 @@ bool IsRunAsNode() { } #if defined(OS_WIN) -bool IsCygwin() { - std::string os; - scoped_ptr env(base::Environment::Create()); - return env->GetVar("OS", &os) && os == "cygwin"; -} - // Win8.1 supports monitor-specific DPI scaling. bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) { typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS); @@ -109,7 +99,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); // Make output work in console if we are not in cygiwn. - if (!IsCygwin() && !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE")) { + if (!IsEnvSet("TERM") && !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE")) { AttachConsole(ATTACH_PARENT_PROCESS); FILE* dontcare; -- 2.7.4