diff options
author | Kevin McCarthy <kevin@8t8.us> | 2021-06-29 12:29:42 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-06-29 12:29:42 -0700 |
commit | 72fecfd6b742dca17037b07e754b632de90e1bfc (patch) | |
tree | 2388a4a17f9daea6f95f27bc84f91696a8a67b24 /main.c | |
parent | b53593393bab8bc0733a39a772219cf92f5a8b49 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 (); |