shithub: patch

Download patch

ref: dd86ce4a9519449b063550a35478ff9168c517ea
parent: 5d573a7488a90cc810e74b1322898845b17d5ae9
author: noodle <noodle@pastanoggin.com>
date: Sun Jan 11 00:45:07 EST 2026

add rio-literalnext: allow escaping C0 control codes via ^'

--- /dev/null
+++ b/rio-literalnext
@@ -1,0 +1,62 @@
+diff 24b39ab89c9fbcac2905a0a6949f07f16fea280b uncommitted
+--- a/sys/include/keyboard.h
++++ b/sys/include/keyboard.h
+@@ -60,6 +60,7 @@
+ 	Keof=	0x04,
+ 	Kenq=	0x05,
+ 	Kack=	0x06,
++	Kbel=	0x07,
+ 	Kbs=	0x08,
+ 	Knack=	0x15,
+ 	Ketb=	0x17,
+--- a/sys/src/cmd/rio/wind.c
++++ b/sys/src/cmd/rio/wind.c
+@@ -842,6 +842,7 @@
+ static void
+ wkeyctl(Window *w, Rune r)
+ {
++	static literal;
+ 	uint q0 ,q1;
+ 	int n, nb;
+ 	int *notefd;
+@@ -856,6 +857,10 @@
+ 	case Kaltgr:
+ 		return;
+ 	}
++	if(literal){
++		literal = 0;
++		goto Ordinary;
++	}
+ 
+ 	if(w->i==nil)
+ 		return;
+@@ -932,6 +937,9 @@
+ 			wsetselect(w, w->qh, w->qh);
+ 			wshow(w, w->q0);
+ 			return;
++		case Kbel:	/* ^': literal next */
++			literal = 1;
++			return;
+ 		}
+ 	if(w->rawing && (w->q0==w->nr || w->mouseopen)){
+ 		waddraw(w, &r, 1);
+@@ -983,6 +991,8 @@
+ 		}
+ 		return;
+ 	}
++
++	Ordinary:
+ 	/* otherwise ordinary character; just insert */
+ 	q0 = w->q0;
+ 	q0 = winsert(w, &r, 1, q0);
+--- a/sys/src/cmd/samterm/samterm.h
++++ b/sys/src/cmd/samterm/samterm.h
+@@ -8,8 +8,6 @@
+ enum{
+ 	Up,
+ 	Down,
+-
+-	Kbel=0x7,
+ };
+ 
+ typedef struct Text	Text;
--