summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-06-29 12:29:42 -0700
committerKevin McCarthy <kevin@8t8.us>2021-06-29 12:29:42 -0700
commit72fecfd6b742dca17037b07e754b632de90e1bfc (patch)
tree2388a4a17f9daea6f95f27bc84f91696a8a67b24 /main.c
parentb53593393bab8bc0733a39a772219cf92f5a8b49 (diff)
Check stdout is a terminal in curses mode.
Mutt uses the standard initscr(), which writes to stdout. Ensure it's available (e.g. hasn't been closed or redirected).
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 329db223..519295d0 100644
--- a/main.c
+++ b/main.c
@@ -847,6 +847,10 @@ int main (int argc, char **argv, char **environ)
sendflags = SENDBATCH;
}
+ /* Check to make sure stdout is available in curses mode. */
+ if (!option (OPTNOCURSES) && !isatty (1))
+ exit (1);
+
/* Always create the mutt_windows because batch mode has some shared code
* paths that end up referencing them. */
mutt_init_windows ();