From f71dbd64130a862802ca8e1b9de87faeaf412d06 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 3 Mar 2021 23:55:34 -0500 Subject: [PATCH] properly reposition cursor on shutdown in 0 render case --- src/lib/notcurses.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 861f4e7f0..c8a448aa6 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1206,8 +1206,11 @@ int notcurses_stop(notcurses* nc){ // if we were not using the alternate screen, our cursor's wherever we last // wrote. move it to the bottom left of the screen. if(!nc->tcache.smcup){ + // FIXME combine into a single cup (heh)? tty_emit(tiparm(nc->tcache.hpa, 0), nc->ttyfd); - tty_emit(tiparm(nc->tcache.vpa, nc->lfdimy + nc->margin_t - 1), nc->ttyfd); + if(nc->lfdimy){ + tty_emit(tiparm(nc->tcache.vpa, nc->lfdimy + nc->margin_t - 1), nc->ttyfd); + } } if(nc->ttyfd >= 0){ ret |= close(nc->ttyfd);