[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: future of MiNT



Eric R. Smith writes:

> Actually, I have been (slowly) working my way through the accumulated
> patches to 1.09. What I can do is send out a 1.10 next week, that may or
> may not include everyone's favorite patches; I would then suggest that
> you send me diffs relative to that, and we can produce a 1.11 for
> release. How does that sound?

 sounds good!

 here is my 1.09 version of the select()-after-XKEY-single-char-read fix...

diff -ru ../console.c ./console.c
--- ../console.c	Tue May  4 17:42:38 1993
+++ ./console.c	Sun Jul 11 02:08:50 1993
@@ -7,6 +7,8 @@
 
 #include "mint.h"
 
+extern char vt52xkey[];
+
 /*
  * These routines are what Cconout, Cauxout, etc. ultimately call.
  * They take an integer argument which is the user's file handle,
@@ -28,6 +30,13 @@
 	r = 1;		/* default is to assume input waiting (e.g. TOS files)*/
 	(void)(*f->dev->ioctl)(f, FIONREAD, &r);
 
+	if (!r && is_terminal(f)) {
+		struct tty *tty = (struct tty *)f->devinfo;
+		int scan = tty->state & TS_ESC;
+
+		if (scan && (tty->xkey ? tty->xkey[scan] : vt52xkey[scan]))
+			r = 1;
+	}
 	return r;
 }
 
diff -ru ../dosfile.c ./dosfile.c
--- ../dosfile.c	Thu Jun 24 20:36:08 1993
+++ ./dosfile.c	Sun Jul 11 03:01:02 1993
@@ -8,6 +8,8 @@
 
 #include "mint.h"
 
+extern char vt52xkey[];
+
 static long do_dup P_((int,int));
 static void unselectme P_((PROC *));
 
@@ -925,6 +926,14 @@
 		r = (*f->dev->ioctl)(f, cmd, (void *)arg);
 		if (r == EINVFN && is_terminal(f)) {
 			r = tty_ioctl(f, cmd, (void *)arg);
+		} else if (cmd == FIONREAD && !r && !(*(long *)arg) &&
+				is_terminal(f)) {
+			struct tty *tty = (struct tty *)f->devinfo;
+			int scan = tty->state & TS_ESC;
+
+			if (scan && (tty->xkey ? tty->xkey[scan] :
+					vt52xkey[scan]))
+				*(long *)arg = 1;
 		}
 		return r;
 	}
@@ -1007,8 +1016,15 @@
 
 	for (i = 0; i < MAX_OPEN; i++) {
 		if (rfd & mask) {
+			struct tty *tty;
+			int scan;
+
 			f = p->handle[i];
-			if ((*f->dev->select)(f, (long)p, O_RDONLY)) {
+			if ((*f->dev->select)(f, (long)p, O_RDONLY) ||
+			    (is_terminal(f) &&
+				(scan = (tty=(struct tty *)f->devinfo)->state & TS_ESC) &&
+				(tty->xkey ? tty->xkey[scan] :
+					vt52xkey[scan]))) {
 				count++;
 				*rfdp |= mask;
 			}
diff -ru ../tty.c ./tty.c
--- ../tty.c	Thu Jun 24 20:37:28 1993
+++ ./tty.c	Sun Jul 11 01:49:02 1993
@@ -233,7 +233,7 @@
 
 /* for RAW mode, if there are no more characters then break */
 		if ( (mode & (T_RAW|T_CBREAK)) &&
-		    !((rdmode & ESCSEQ) && (tty->state & TS_ESC))) {
+		    !(tty->state & TS_ESC)) {
 			r = 1;
 			(void)(*f->dev->ioctl)(f, FIONREAD, &r);
 			if (r <= 0) break;
@@ -375,7 +375,7 @@
  *		28-31 are shift+cursor up, down, right, and left
  */
 
-static char vt52xkey[256] = {
+char vt52xkey[256] = {
 '\033', 'P', 0, 0, 0, 0, 0, 0,
 '\033', 'Q', 0, 0, 0, 0, 0, 0,
 '\033', 'R', 0, 0, 0, 0, 0, 0,
@@ -665,19 +665,15 @@
 /* we may be in the middle of an escape sequence */
 	scan = (tty->state & TS_ESC);
 	if (scan != 0) {
-		if (mode & ESCSEQ) {
-			tab = tty->xkey ? tty->xkey : vt52xkey;
-			r = (unsigned char) tab[scan++];
-			if (r) {
-				c = UNDEF;
-				if (tab[scan] == 0) scan = 0;
-			}
-			else
-				scan = 0;
-			tty->state = (tty->state & ~TS_ESC) | scan;
+		tab = tty->xkey ? tty->xkey : vt52xkey;
+		r = (unsigned char) tab[scan++];
+		if (r) {
+			c = UNDEF;
+			if (tab[scan] == 0) scan = 0;
 		}
 		else
-			tty->state &= ~TS_ESC;
+			scan = 0;
+		tty->state = (tty->state & ~TS_ESC) | scan;
 	}
 
 	while (c != UNDEF) {

 chhers
	Juergen
-- 
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA