From b6a354980d7c23bb34372b03ea08272aa74c27e6 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 1 Oct 2008 15:03:53 +0000 Subject: [PATCH] make isatty() available for stdout/stderr (hope it works on MS Windows) --- src/Main/fg_init.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 08f315a42..9e21c719f 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -35,6 +35,8 @@ #if defined( _MSC_VER) || defined(__MINGW32__) # include // for getcwd() # define getcwd _getcwd +# include // isatty() +# define isatty _isatty #endif // work around a stdc++ lib bug in some versions of linux, but doesn't @@ -1186,6 +1188,9 @@ bool fgInitGeneral() { curr = curr->getChild("fg-current", 0, true); curr->setStringValue(cwd ? cwd : ""); curr->setAttribute(SGPropertyNode::WRITE, false); + + fgSetBool("/sim/startup/stdout-to-terminal", isatty(1)); + fgSetBool("/sim/startup/stderr-to-terminal", isatty(2)); return true; } -- 2.39.5