don't emit smkx twice, flatten all initial writes

pull/1867/head
nick black 3 years ago
parent f401d85733
commit 4ed41259c9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -834,9 +834,17 @@ ncdirect* ncdirect_core_init(const char* termtype, FILE* outfp, uint64_t flags){
TERMINAL_UNKNOWN, NULL, NULL)){
goto err;
}
if(ncvisual_init(NCLOGLEVEL_SILENT)){
if(ncvisual_init(loglevel)){
goto err;
}
// if the keypad neen't be explicitly enabled, smkx is not present
const char* smkx = get_escape(&ret->tcache, ESCAPE_SMKX);
if(smkx){
if(term_emit(tiparm(smkx), ret->ttyfp, true) < 0){
fprintf(stderr, "Error entering keypad transmit mode\n");
goto err;
}
}
update_term_dimensions(ret->ctermfd, NULL, NULL, &ret->tcache, 0);
ncdirect_set_styles(ret, 0);
return ret;

@ -1145,6 +1145,10 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
goto err;
}
}
if((ret->rstate.mstreamfp = open_memstream(&ret->rstate.mstream, &ret->rstate.mstrsize)) == NULL){
free_plane(ret->stdplane);
goto err;
}
const char* smkx = get_escape(&ret->tcache, ESCAPE_SMKX);
if(smkx && term_emit(smkx, ret->ttyfp, false)){
free_plane(ret->stdplane);
@ -1155,13 +1159,12 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
free_plane(ret->stdplane);
goto err;
}
if((ret->rstate.mstreamfp = open_memstream(&ret->rstate.mstream, &ret->rstate.mstrsize)) == NULL){
ret->rstate.x = ret->rstate.y = -1;
int bannerlines = init_banner(ret);
if(ncflush(ret->ttyfp)){
free_plane(ret->stdplane);
goto err;
}
ret->rstate.x = ret->rstate.y = -1;
int bannerlines = init_banner(ret);
ncflush(ret->ttyfp);
if(cursor_y >= 0 && cursor_x >= 0){
cursor_y += bannerlines;
if(cursor_y >= ncplane_dim_y(ret->stdplane)){

@ -1121,7 +1121,7 @@ raster_and_write(notcurses* nc, ncpile* p, FILE* out){
}
// if the last pile was different from this one, we need clear all old
// sprixels (and invalidate all those of the current pile -- FIXME).
if(nc->last_pile != p){
if(nc->last_pile != p && nc->last_pile){
if(sprite_clear_all(&nc->tcache, out)){
return -1;
}

@ -640,14 +640,6 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
goto err;
}
}
// if the keypad neen't be explicitly enabled, smkx is not present
const char* smkx = get_escape(ti, ESCAPE_SMKX);
if(smkx && fd >= 0){
if(tty_emit(tiparm(smkx), fd) < 0){
fprintf(stderr, "Error entering keypad transmit mode\n");
goto err;
}
}
// if op is defined as ansi 39 + ansi 49, make the split definitions
// available. this ought be asserted by extension capability "ax", but
// no terminal i've found seems to do so. =[

Loading…
Cancel
Save