Skip to content
Snippets Groups Projects
Commit 85f37c8f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

If stdout is a tty, use ANSI output mode

Should make DigitalMan happy by making help output be in the console
on Windows with syncterm.com.  Hopefully syncterm.exe doesn't get
the help output hosed by this.

Also, if the output mode is ANSI, don't require a key press to exit.
parent a489c48d
No related branches found
No related tags found
No related merge requests found
Pipeline #7976 passed
......@@ -2264,6 +2264,8 @@ main(int argc, char **argv)
USAGE:
if (bbs_alloc)
free(bbs);
if (cio_api.mode == CIOLIB_MODE_AUTO && isatty(STDOUT_FILENO))
initciolib(CIOLIB_MODE_ANSI);
uifcbail();
clrscr();
gettextinfo(&txtinfo);
......@@ -2292,11 +2294,13 @@ USAGE:
}
}
textattr(WHITE);
cputs("<Press A Key to Exit>");
switch (getch()) {
case 0:
case 0xe0:
getch();
if (cio_api.mode != CIOLIB_MODE_ANSI) {
cputs("<Press A Key to Exit>");
switch (getch()) {
case 0:
case 0xe0:
getch();
}
}
textattr(LIGHTGRAY);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment