diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-10-19 19:16:28 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-10-19 19:16:28 -0700 |
commit | da5249a364aac3ec1b6d28dd7200cf6cdd9a2913 (patch) | |
tree | e7edeec1163420ca06c59eacc88917fa72c8d110 /terminal.c | |
parent | 70a4bf6d6b7c79c936e96fc8e3cceb96c125695a (diff) |
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Diffstat (limited to 'terminal.c')
-rw-r--r-- | terminal.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -17,9 +17,15 @@ void cleanup_terminal() unlink(OUTPUT_PATH); } +static char init_done; + +void force_no_terminal() +{ + init_done = 1; +} + void init_terminal() { - static char init_done; if (!init_done) { if (!(isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))) { #ifndef __APPLE__ @@ -32,7 +38,7 @@ void init_terminal() //create FIFOs for talking to helper process in terminal app mkfifo(INPUT_PATH, 0666); mkfifo(OUTPUT_PATH, 0666); - + //close existing file descriptors close(STDIN_FILENO); close(STDOUT_FILENO); @@ -59,7 +65,7 @@ void init_terminal() } } } - + init_done = 1; } } |