diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-10-20 21:49:10 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-10-20 21:49:10 +0000 |
commit | 69cbd24de47f4a5f72cfe85c346056f1a0c30d90 (patch) | |
tree | ad409726f19a366bf7f586d0471b79d446cd1da9 /src/main | |
parent | 4af7ae6c56153347035656a2596254c1a8a17668 (diff) |
Adding detection of TTY vs. piped input for interactive mode
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/main.cpp | 13 |
1 files 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 <iostream> -#include <fstream> #include <cstdlib> #include <cstring> +#include <fstream> +#include <iostream> #include <new> +#include <stdio.h> +#include <unistd.h> + #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); |