diff --git a/src/info/main.c b/src/info/main.c index 95dbf92b7..c503c0a11 100644 --- a/src/info/main.c +++ b/src/info/main.c @@ -246,7 +246,6 @@ tinfo_debug_bitmaps(struct ncplane* n, const tinfo* ti, const char* indent){ } char* path = prefix_data("notcurses.png"); if(path){ - // FIXME hold off until #1883 is resolved display_logo(ti, n, path); free(path); } diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index b41b64df6..1db3126d7 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1158,7 +1158,7 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){ free_plane(ret->stdplane); goto err; } - if(ret->rstate.logendy >= 0 && ret->rstate.logendx >= 0){ + if(ret->rstate.logendy >= 0){ // if either is set, both are if(!ret->suppress_banner){ if(locate_cursor_early(ret, &ret->rstate.logendy, &ret->rstate.logendx)){ free_plane(ret->stdplane); diff --git a/src/lib/render.c b/src/lib/render.c index f255f058c..bb4624b2d 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -1222,6 +1222,8 @@ notcurses_rasterize(notcurses* nc, ncpile* p, FILE* out){ int ret = raster_and_write(nc, p, out); if(cursory >= 0){ notcurses_cursor_enable(nc, cursory, cursorx); + }else if(nc->rstate.logendy >= 0){ + goto_location(nc, nc->ttyfp, nc->rstate.logendy, nc->rstate.logendx); } nc->last_pile = p; return ret; @@ -1536,21 +1538,24 @@ int notcurses_cursor_enable(notcurses* nc, int y, int x){ if(nc->cursory == y && nc->cursorx == x){ return 0; } - const char* cnorm = get_escape(&nc->tcache, ESCAPE_CNORM); - if(nc->ttyfd < 0 || !cnorm){ + if(nc->ttyfd < 0){ return -1; } // updates nc->rstate.cursor{y,x} if(goto_location(nc, nc->ttyfp, y + nc->margin_t, x + nc->margin_l)){ return -1; } + if(ncflush(nc->ttyfp)){ + return -1; + } // if we were already positive, we're already visible, no need to write cnorm if(nc->cursory >= 0 && nc->cursorx >= 0){ nc->cursory = y; nc->cursorx = x; return 0; } - if(tty_emit(cnorm, nc->ttyfd) || ncflush(nc->ttyfp)){ + const char* cnorm = get_escape(&nc->tcache, ESCAPE_CNORM); + if(!cnorm || tty_emit(cnorm, nc->ttyfd)){ return -1; } nc->cursory = y;