diff --git a/noice.c b/noice.c index 489caabe..a588a55c 100644 --- a/noice.c +++ b/noice.c @@ -257,7 +257,16 @@ entrycmp(const void *va, const void *vb) void initcurses(void) { - initscr(); + char *term; + + if (initscr() == NULL) { + term = getenv("TERM"); + if (term != NULL) + fprintf(stderr, "error opening terminal: %s\n", term); + else + fprintf(stderr, "failed to initialize curses\n"); + exit(1); + } cbreak(); noecho(); nonl();