Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/metamath.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,14 @@
#include "mmword.h"
#include "mmwtex.h"

// Windows doesn't have the <unistd> header, but it has an isatty equivalent
#ifdef _WIN32
#include <io.h>
#define _isatty isatty
#else
#include <unistd.h>
#endif

void command(int argc, char *argv[]);

int main(int argc, char *argv[]) {
Expand Down Expand Up @@ -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) */
Expand Down