summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-06-22 16:44:28 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-06-22 16:44:28 +0300
commit1f25222c5ca18e1b86462d06b6c2049a46ec86fa (patch)
tree0368322593689a6568b16b35f8a367a20812a5e4
parent292e063f94b64123b4ef214a3ae50dfb25d9c910 (diff)
downloadwafflestone-1f25222c5ca18e1b86462d06b6c2049a46ec86fa.tar.xz
Make read(STDIN_FILENO, ...) non-blocking
-rw-r--r--framebuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/framebuffer.c b/framebuffer.c
index 7199052..36969e0 100644
--- a/framebuffer.c
+++ b/framebuffer.c
@@ -67,8 +67,8 @@ void term_init(void) {
new.c_lflag &= ~ICANON; /* Turn off canonical mode */
new.c_lflag &= ~ECHO; /* Turn off echoing */
- new.c_cc[VMIN] = 1; /* One char at a time */
- new.c_cc[VTIME] = 0; /* No input timeout */
+ new.c_cc[VMIN] = 0; /* Return read(STDIN_FILENO, ...) even if no input */
+ new.c_cc[VTIME] = 0; /* ^, make it return immediately, without waiting */
tcsetattr(0, TCSANOW, &new);
write(STDOUT_FILENO, "\x1b[?1049h", 8); /* Alternative screen buffer */