diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-22 18:01:49 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-22 18:01:49 +0200 |
commit | 5d7a77cf57a1a3c1b5b1b8203fa9b53dc38561ed (patch) | |
tree | cce2ffbd6f325332f26b422bfaace46118c600c3 /sys/src/cmd/vt/main.c | |
parent | c5b2927250f2dea07747150687239bdc883100a2 (diff) |
vt: fix xterm cursor keys
Diffstat (limited to 'sys/src/cmd/vt/main.c')
-rw-r--r-- | sys/src/cmd/vt/main.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/src/cmd/vt/main.c b/sys/src/cmd/vt/main.c index 94877d3f3..7cecb4b49 100644 --- a/sys/src/cmd/vt/main.c +++ b/sys/src/cmd/vt/main.c @@ -214,7 +214,7 @@ initialize(int argc, char **argv) fontname = nil; term = "vt100"; fk = vt100fk; - blkbg = nocolor = 0; + blkbg = 0; rflag = 0; attr = defattr; ARGBEGIN{ @@ -315,8 +315,9 @@ drawscreen(void) uchar c, *ap, *cp; Rune *rp; - /* draw background */ draw(screen, screen->r, bgcolor, nil, ZP); + + /* draw background */ for(y = 0; y <= ymax; y++){ for(x = 0; x <= xmax; x += n){ cp = onscreenc(x, y); @@ -983,6 +984,18 @@ pos(Point pt) } void +shift(int x1, int y, int x2, int w) +{ + if(x1+w > xmax+1) + w = xmax+1 - x1; + if(x2+w > xmax+1) + w = xmax+1 - x2; + memmove(onscreenr(x1, y), onscreenr(x2, y), w*sizeof(Rune)); + memmove(onscreena(x1, y), onscreena(x2, y), w); + memmove(onscreenc(x1, y), onscreenc(x2, y), w); +} + +void scroll(int sy, int ly, int dy, int cy) /* source, limit, dest, which line to clear */ { memmove(onscreenr(0, dy), onscreenr(0, sy), (ly-sy)*(xmax+2)*sizeof(Rune)); |