https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b706c6b479422d31f0124b92c21b4cb536bbddff
commit b706c6b479422d31f0124b92c21b4cb536bbddff Author: Corinna Vinschen <cori...@vinschen.de> Date: Wed Aug 23 17:43:41 2017 +0200 cygwin: only expose /dev/con{in,out,sole} when started from a Windows console Signed-off-by: Corinna Vinschen <cori...@vinschen.de> Diff: --- winsup/cygwin/fhandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 153e384..cd73e6e 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1439,7 +1439,7 @@ private: ssize_t __stdcall write (const void *ptr, size_t len); void doecho (const void *str, DWORD len) { (void) write (str, len); } int close (); - static bool exists () {return !!GetConsoleCP ();} + static bool exists () {return shared_console_info && !!GetConsoleCP ();} int tcflush (int); int tcsetattr (int a, const struct termios *t);