From a70c8cb2046646cca8654d59e2510634984b9c10 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sat, 7 Nov 2020 21:08:34 -0800 Subject: [PATCH] vere: print error and exit if stdin is not a tty --- pkg/urbit/vere/io/term.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/urbit/vere/io/term.c b/pkg/urbit/vere/io/term.c index 273092682..937ccf156 100644 --- a/pkg/urbit/vere/io/term.c +++ b/pkg/urbit/vere/io/term.c @@ -147,6 +147,12 @@ u3_term_log_init(void) { uty_u->fid_i = 0; // stdin, yes we write to it... + if ( !isatty(uty_u->fid_i) ) { + fprintf(stderr, "vere: unable to initialize terminal (not a tty)\r\n" + " use -t to disable interactivity\r\n"); + u3_king_bail(); + } + uv_pipe_init(u3L, &(uty_u->pop_u), 0); uv_pipe_open(&(uty_u->pop_u), uty_u->fid_i); }