From 0ebdd93e0072788a852b0fae1e0755e3bec9faac Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 8 May 2020 15:55:19 +0100 Subject: [PATCH] Fix #11667: Memory dumps being generated every time the game is closed --- src/openrct2/interface/StdInOutConsole.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/openrct2/interface/StdInOutConsole.cpp b/src/openrct2/interface/StdInOutConsole.cpp index ae60a1e033..27de5e16d4 100644 --- a/src/openrct2/interface/StdInOutConsole.cpp +++ b/src/openrct2/interface/StdInOutConsole.cpp @@ -7,6 +7,11 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +// Ignore isatty warning on WIN32 +#ifndef _CRT_NONSTDC_NO_WARNINGS +# define _CRT_NONSTDC_NO_WARNINGS +#endif + #include "../Context.h" #include "../OpenRCT2.h" #include "../platform/Platform2.h" @@ -19,6 +24,12 @@ using namespace OpenRCT2; void StdInOutConsole::Start() { + // Only start if stdin is a TTY + if (!isatty(fileno(stdin))) + { + return; + } + std::thread replThread([this]() -> void { linenoise::SetMultiLine(true); linenoise::SetHistoryMaxLen(32);