shithub: riscv

Download patch

ref: 283a1c0788a89493a5a0a46c561d19f2231b9227
parent: 219050cc36b169a1f55b5441553bc8e123ddfa7e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Apr 18 22:18:28 EDT 2017

vt: but not too fast :-)

if drawing can't keep up with the host, make sure we
eventually redraw the screen and check for user events.

--- a/sys/src/cmd/vt/main.c
+++ b/sys/src/cmd/vt/main.c
@@ -645,7 +645,7 @@
 				return(rcvchar());
 			free(hostbuf);
 			hostbufp = hostbuf = nbrecvp(hc);
-			if(host_avail())
+			if(host_avail() && nrand(8))
 				return(rcvchar());
 		}
 		drawscreen();
@@ -662,10 +662,13 @@
 		{ mc->c, &mc->Mouse, CHANRCV },
 		{ mc->resizec, nil, CHANRCV },
 		{ kc->c, &kbdchar, CHANRCV },
-		{ hc, &hostbuf, CHANNOP },
+		{ hc, &hostbuf, CHANRCV },
 		{ nil, nil, CHANEND },
 	};
-	if(hostbuf == nil) a[AHOST].op = CHANRCV;
+	if(blocked)
+		a[AHOST].op = CHANNOP;
+	else if(hostbuf != nil)
+		a[AHOST].op = CHANNOBLK;
 Next:
 	if(display->bufp > display->buf)
 		flushimage(display, 1);