mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
screen_init(): Verify that STDOUT is a TTY
Before we call screen_init(), which in turn calls libite:initscr(), which in turn does a lot of tcgetattr() and termios to STDOUT to figure out the size, we need to check that we're not backgrounded, or don't actually have a TTY. Problem reported by @wkz Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
949f02eff4
commit
a6290da210
1 file changed
+3
@@ -75,6 +75,9 @@ char *sanitize(char *arg, size_t len)
|
||||
|
||||
void screen_init(void)
|
||||
{
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
return
|
||||
|
||||
initscr(&screen_rows, &screen_cols);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user