scroll

scrollbackbuffer program for st
git clone git://git.suckless.org//gitrepos
Log | Files | Refs

commit de79f8faad5df3735f2e53d7881a5782379efc2a
parent 38a8477973fc8fa69512e5e079c060b67c9eccd6
Author: Jan Klemkow <j.klemkow@wemelug.de>
Date:   Tue, 31 Mar 2020 22:07:10 +0200

add some comments

Diffstat:
Mscroll.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/scroll.c b/scroll.c @@ -322,11 +322,13 @@ main(int argc, char *argv[]) if (argc <= 1) die("usage: scroll <program>"); + /* save terminal settings for resetting after exit */ if (tcgetattr(STDIN_FILENO, &dfl) == -1) die("tcgetattr:"); if (atexit(reset)) die("atexit:"); + /* get window size of the terminal */ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) < 0) die("ioctl:"); @@ -404,6 +406,7 @@ main(int argc, char *argv[]) /* iterate over the input buffer */ for (char *c = input; n-- > 0; c++) { + /* don't save lines from alternative screen */ if (!isaltscreen(*c)) { if (*c == '\r') { addline(buf, pos);