ref: c6359c3090bf0ca958aab17693567e1b00825213
parent: c4fd860a561c40c7f161ff9d5886acf6f839687d
author: cinap_lenrek <[email protected]>
date: Tue Aug 22 18:48:01 EDT 2017
vt: turn off nl -> nl+cr translation default in raw mode, don't scroll more than screen height
--- a/sys/src/cmd/vt/main.c
+++ b/sys/src/cmd/vt/main.c
@@ -101,7 +101,7 @@
};
/* terminal control */
-struct ttystate ttystate[2] = { {0, 1}, {0, 1} };
+struct ttystate ttystate[2] = { {0, 1}, {0, 0} };
Point margin;
Point ftsize;
@@ -347,10 +347,9 @@
hidecursor();
- if(scrolloff != 0){
- n = scrolloff % (ymax+1);
- draw(screen, Rpt(pt(0,0), pt(xmax+2, ymax+1-n)), screen, nil, pt(0, n));
- }
+ if(scrolloff && scrolloff <= ymax)
+ draw(screen, Rpt(pt(0,0), pt(xmax+2, ymax+1-scrolloff)),
+ screen, nil, pt(0, scrolloff));
for(y = 0; y <= ymax; y++){
if(!screenchange(y))