From a6290da2101b65a987d509e7e5a3777a3297d137 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 23 Oct 2017 19:16:51 +0200 Subject: [PATCH] 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 --- src/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.c b/src/util.c index 87967442..c8e8fdba 100644 --- a/src/util.c +++ b/src/util.c @@ -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); }