aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--noice.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index 489caab..a588a55 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();