Switched stdout back to stderr to work properly with pipeline.

This commit is contained in:
Bruce Hill 2019-01-05 19:22:25 -08:00
parent 3a42f31a4a
commit 185f9a6b42

View File

@ -195,7 +195,7 @@ int main(int argc, char *argv[])
perror("fopen(/dev/tty)"); perror("fopen(/dev/tty)");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
SCREEN *screen = newterm(term_type, stdout, term_in); SCREEN *screen = newterm(term_type, stderr, term_in);
set_term(screen); set_term(screen);
set_escdelay(5); set_escdelay(5);
W = getmaxx(stdscr); W = getmaxx(stdscr);
@ -351,7 +351,7 @@ int main(int argc, char *argv[])
case 'q': case 'Q': case KEY_CANCEL: case KEY_CLOSE: case KEY_EXIT: case 27: case 'q': case 'Q': case KEY_CANCEL: case KEY_CLOSE: case KEY_EXIT: case 27:
endwin(); endwin();
write(1, outbuf, buf_i); write(STDOUT_FILENO, outbuf, buf_i);
return 0; return 0;
default: goto next_input; default: goto next_input;