employ XTPUSHCOLORS/XTPOPCOLORS where supported #1296

pull/1935/head
nick black 3 years ago
parent 95cdfd7524
commit 99217a7e27
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -35,6 +35,9 @@ void notcurses_version_components(int* major, int* minor, int* patch, int* tweak
int reset_term_attributes(const tinfo* ti, FILE* fp){
int ret = 0;
const char* esc;
if((esc = get_escape(ti, ESCAPE_RESTORECOLORS)) && term_emit(esc, fp, false)){
ret = -1;
}
if((esc = get_escape(ti, ESCAPE_OP)) && term_emit(esc, fp, false)){
ret = -1;
}
@ -1162,6 +1165,11 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
free_plane(ret->stdplane);
goto err;
}
const char* pushcolors = get_escape(&ret->tcache, ESCAPE_SAVECOLORS);
if(pushcolors && term_emit(pushcolors, ret->ttyfp, false)){
free_plane(ret->stdplane);
goto err;
}
ret->rstate.x = ret->rstate.y = -1;
init_banner(ret);
if(ncflush(ret->ttyfp)){

Loading…
Cancel
Save