From 588f8d3789dce405d3d23badf120fc9c4711e371 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 4 Jul 2021 00:05:51 -0400 Subject: [PATCH] drop signals at the end of reset_term_attributes() #1872 --- src/lib/notcurses.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index fde86b1e7..e092b21a8 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -53,7 +53,7 @@ int reset_term_attributes(const tinfo* ti, FILE* fp){ static int notcurses_stop_minimal(void* vnc){ notcurses* nc = vnc; - int ret = drop_signals(nc); + int ret = 0; // be sure to write the restoration sequences *prior* to running rmcup, as // they apply to the screen (alternate or otherwise) we're actually using. const char* esc; @@ -86,6 +86,9 @@ notcurses_stop_minimal(void* vnc){ if(ncflush(nc->ttyfp)){ ret = -1; } + // see #1872; without keeping this at the end, we run into mysterious, + // poorly-understood issues during shutdown =[. cowardly. FIXME + ret |= drop_signals(nc); return ret; }