From 69cbd24de47f4a5f72cfe85c346056f1a0c30d90 Mon Sep 17 00:00:00 2001 From: "Christopher L. Conway" Date: Wed, 20 Oct 2010 21:49:10 +0000 Subject: [PATCH] Adding detection of TTY vs. piped input for interactive mode --- src/main/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); -- 2.30.2