From 15c13898eaa0db2d2ce8f3742a95255fa60859f4 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 7 Dec 2019 22:26:35 -0500 Subject: [PATCH] don't require civis if retaining cursor --- src/lib/notcurses.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 8b8267868..d87967e1e 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -500,18 +500,15 @@ interrogate_terminfo(notcurses* nc, const notcurses_options* opts){ nc->colors); } term_verify_seq(&nc->cup, "cup"); - term_verify_seq(&nc->civis, "civis"); - if(nc->cup == NULL || nc->civis == NULL){ + if(nc->cup == NULL){ fprintf(stderr, "Required terminfo capability not defined\n"); return -1; } if(!opts->retain_cursor){ - if(term_emit(nc->civis, opts->outfp, false)){ - return -1; - } + term_verify_seq(&nc->civis, "civis"); term_verify_seq(&nc->cnorm, "cnorm"); }else{ - nc->cnorm = NULL; + nc->civis = nc->cnorm = NULL; } term_verify_seq(&nc->standout, "smso"); // smso / rmso term_verify_seq(&nc->uline, "smul"); @@ -654,11 +651,15 @@ notcurses* notcurses_init(const notcurses_options* opts){ if((ret->stdscr = create_initial_ncplane(ret)) == NULL){ goto err; } - if(ret->smkx && term_emit(ret->smkx, ret->ttyfp, true)){ + if(ret->civis && term_emit(ret->civis, ret->ttyfp, false)){ + free_plane(ret->top); + goto err; + } + if(ret->smkx && term_emit(ret->smkx, ret->ttyfp, false)){ free_plane(ret->top); goto err; } - if(ret->smcup && term_emit(ret->smcup, ret->ttyfp, true)){ + if(ret->smcup && term_emit(ret->smcup, ret->ttyfp, false)){ free_plane(ret->top); goto err; }