diff --git a/src/main.zig b/src/main.zig index de05866..1a47ebe 100644 --- a/src/main.zig +++ b/src/main.zig @@ -65,5 +65,12 @@ pub fn main() !void { defer thread_manager.deinit(); var f = std.io.getStdIn(); - try input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator); + input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator) catch |err| { + switch (err) { + util.Errors.EOFError => { + return; + }, + else => return err, + } + }; } diff --git a/src/util.zig b/src/util.zig index e8473e9..ddb5b2e 100644 --- a/src/util.zig +++ b/src/util.zig @@ -1,5 +1,9 @@ const std = @import("std"); +pub const Errors = error{ + EOFError, +}; + pub const Options = struct { width: usize, height: usize,