fix(app): do not reset remaining bytes after reading
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m15s

This commit is contained in:
2026-01-22 07:15:46 +01:00
parent bfbe75f8d3
commit 39fb8af174

View File

@@ -178,10 +178,9 @@ pub fn App(comptime M: type, comptime E: type) type {
else => |e| return e,
};
}
var remaining_bytes: usize = 0;
while (true) {
this.quit_event.timedWait(20 * std.time.ns_per_ms) catch {
var remaining_bytes: usize = 0;
// non-blocking read
const read_bytes = terminal.read(buf[remaining_bytes..]) catch |err| switch (err) {
error.WouldBlock => {
@@ -191,6 +190,7 @@ pub fn App(comptime M: type, comptime E: type) type {
},
else => return err,
} + remaining_bytes;
remaining_bytes = 0;
// escape key presses
if (buf[0] == 0x1b and read_bytes > 1) {