scroll

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

commit c6622082ff48417e85099a37549e83725227c958
parent 7ebc733b629fd2f8ba09fc5936df2143882d1f64
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Sun,  5 Apr 2020 23:50:02 +0200

Don't strip first two chars if they are not a \r\n

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

diff --git a/scroll.c b/scroll.c @@ -284,8 +284,10 @@ scrollup(int n) write(STDOUT_FILENO, "\033[?25l", 6); /* remove newline of first line as we are at 0,0 already */ - if (scrollend->size > 2) + if (scrollend->size > 1 && scrollend->buf[0] == '\r' && scrollend->buf[1] == '\n') write(STDOUT_FILENO, scrollend->buf + 2, scrollend->size - 2); + else + write(STDOUT_FILENO, scrollend->buf, scrollend->size); bottom = TAILQ_NEXT(bottom, entries); /* print rows lines and move bottom forward to the new screen bottom */