diff --git a/src/metamath.c b/src/metamath.c index 696c3acb..40169094 100644 --- a/src/metamath.c +++ b/src/metamath.c @@ -717,6 +717,14 @@ #include "mmword.h" #include "mmwtex.h" +// Windows doesn't have the header, but it has an isatty equivalent +#ifdef _WIN32 +#include +#define _isatty isatty +#else +#include +#endif + void command(int argc, char *argv[]); int main(int argc, char *argv[]) { @@ -914,7 +922,8 @@ void command(int argc, char *argv[]) { double timeIncr = 0; flag printTime; /* Set by "/ TIME" in SAVE PROOF and others */ - flag defaultScrollMode = 1; /* Default to prompted mode */ + /* Default to prompted mode if run interactively, else continuous mode */ + flag defaultScrollMode = isatty(STDIN_FILENO) != 0; /* Initialization to avoid compiler warning (should not be theoretically necessary) */