From d022a56cb621859a389656c3e29bd06149687b12 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 22 Aug 2021 15:41:38 -0400 Subject: [PATCH] lack of smcup is not a reason to abort #2085 --- src/lib/notcurses.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 78f0077b8..7f31f074e 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1228,9 +1228,12 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){ // the alternate screen; we're not even going to bother clearing the screen. if(ret->tcache.ttyfd >= 0){ if(!(opts->flags & NCOPTION_NO_ALTERNATE_SCREEN)){ - if(enter_alternate_screen(ret->ttyfp, &ret->tcache, false)){ - free_plane(ret->stdplane); - goto err; + const char* smcup = get_escape(&ret->tcache, ESCAPE_SMCUP); + if(smcup){ + if(enter_alternate_screen(ret->ttyfp, &ret->tcache, false)){ + free_plane(ret->stdplane); + goto err; + } } // perform an explicit clear since the alternate screen was requested // (smcup *might* clear, but who knows? and it might not have been