don't require civis if retaining cursor

pull/124/head
nick black 5 years ago
parent 1b1729133c
commit 15c13898ea
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -500,18 +500,15 @@ interrogate_terminfo(notcurses* nc, const notcurses_options* opts){
nc->colors); nc->colors);
} }
term_verify_seq(&nc->cup, "cup"); term_verify_seq(&nc->cup, "cup");
term_verify_seq(&nc->civis, "civis"); if(nc->cup == NULL){
if(nc->cup == NULL || nc->civis == NULL){
fprintf(stderr, "Required terminfo capability not defined\n"); fprintf(stderr, "Required terminfo capability not defined\n");
return -1; return -1;
} }
if(!opts->retain_cursor){ if(!opts->retain_cursor){
if(term_emit(nc->civis, opts->outfp, false)){ term_verify_seq(&nc->civis, "civis");
return -1;
}
term_verify_seq(&nc->cnorm, "cnorm"); term_verify_seq(&nc->cnorm, "cnorm");
}else{ }else{
nc->cnorm = NULL; nc->civis = nc->cnorm = NULL;
} }
term_verify_seq(&nc->standout, "smso"); // smso / rmso term_verify_seq(&nc->standout, "smso"); // smso / rmso
term_verify_seq(&nc->uline, "smul"); 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){ if((ret->stdscr = create_initial_ncplane(ret)) == NULL){
goto err; 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); free_plane(ret->top);
goto err; 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); free_plane(ret->top);
goto err; goto err;
} }

Loading…
Cancel
Save