From: Christopher L. Conway Date: Wed, 20 Oct 2010 21:49:10 +0000 (+0000) Subject: Adding detection of TTY vs. piped input for interactive mode X-Git-Tag: cvc5-1.0.0~8796 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69cbd24de47f4a5f72cfe85c346056f1a0c30d90;p=cvc5.git Adding detection of TTY vs. piped input for interactive mode --- diff --git a/src/main/main.cpp b/src/main/main.cpp index 2f524c3f6..fd7c1b303 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -16,12 +16,15 @@ ** Main driver for CVC4 executable. **/ -#include -#include #include #include +#include +#include #include +#include +#include + #include "cvc4autoconfig.h" #include "main.h" #include "interactive_shell.h" @@ -125,9 +128,9 @@ int runCvc4(int argc, char* argv[]) { // different from the expected behavior of file input from // stdin, due to EOL escapes in interactive mode - // if(!options.interactiveSetByUser) { - // options.interactive = inputFromStdin; - // } + if(!options.interactiveSetByUser) { + options.interactive = inputFromStdin && isatty(fileno(stdin)); + } // Create the expression manager ExprManager exprMgr(options.earlyTypeChecking);