From: Stefan Sperling Subject: Re: tog: print newline on exit to clear bottom line To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Sat, 19 Sep 2020 20:41:51 +0200 On Sat, Sep 19, 2020 at 04:13:22PM +0200, Christian Weisgerber wrote: > TL;DR: Run "TERM=vt100 tog", quit, see for yourself. > > ---- > Print newline to clear the bottom line when tog exits. > > When a curses(3)-based application exits, the cursor is positioned > at the start of the bottom line, and the shell will issue the new > prompt there. However, the bottom line may still contain remnants > of the curses screen. This is only noticeable on terminals that > do not switch to/from an alternate screen buffer. > ---- > > Applications appear to be split in the way they handle this: > some print a newline to scroll up the old curses screen, others > issue a clear-to-eol. > > Opinions? > OK? A newline seems simple and cannot hurt. No objections here. Though I wonder if this is something endwin() should handle internally. > > diff 6c13dcd2d0d730f9f9fc0fb0c42eb0f409216063 /home/naddy/got > blob - 8eb6e6b273d41c6a726f1e8b5fe1b04fbcd17415 > file + tog/tog.c > --- tog/tog.c > +++ tog/tog.c > @@ -5686,6 +5686,7 @@ main(int argc, char *argv[]) > } > > endwin(); > + putchar('\n'); > if (cmd_argv) { > int i; > for (i = 0; i < argc; i++) > -- > Christian "naddy" Weisgerber naddy@mips.inka.de > >