about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-28 22:35:21 -0400
committerJune McEnroe <june@causal.agency>2021-09-28 22:35:52 -0400
commiteda3629e274f4a7862dd62b1734bdd4eb34f432d (patch)
tree0b6136932c2eb89ce4a3ddaa2f2d48a7bb64d5fe
parentHandle KCGI_EXIT gracefully (diff)
downloadtorus-eda3629e274f4a7862dd62b1734bdd4eb34f432d.tar.gz
torus-eda3629e274f4a7862dd62b1734bdd4eb34f432d.zip
Fix backspace on OpenBSD
Woops! Insert mode without backspace sucks.
-rw-r--r--client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client.c b/client.c
index 8e5d2f2..29c8f38 100644
--- a/client.c
+++ b/client.c
@@ -524,8 +524,12 @@ static void inputDirection(bool keyCode, wchar_t ch) {
 
 static void inputInsert(bool keyCode, wchar_t ch) {
 	if (keyCode) {
-		inputNormal(keyCode, ch);
-		return;
+		if (ch == KEY_BACKSPACE) {
+			ch = '\b';
+		} else {
+			inputNormal(keyCode, ch);
+			return;
+		}
 	}
 	switch (ch) {
 		break; case Esc: {