feat: Exit with ctrl-q.

This commit is contained in:
jmug
2026-10-09 17:36:48 -07:00
parent 908eb1ef1c
commit 0a682b779e
+5 -1
View File
@@ -7,6 +7,10 @@
#include <termios.h>
#include <unistd.h>
/*** defines ***/
#define CTRL_KEY(k) ((k) & 0x1f)
/*** data ***/
struct termios orig_termios;
@@ -57,7 +61,7 @@ int main() {
} else {
printf("%d ('%c')\r\n", c, c);
}
if (c == 'q')
if (c == CTRL_KEY('q'))
break;
}
return 0;