the.bay.news

stdin_reader.takeDelimiterExclusive returns immediately in a loop instead of blocking for input (Zig 0.16, new Io interface)

Ziggit
stdin_reader.takeDelimiterExclusive returns immediately in a loop instead of blocking for input (Zig 0.16, new Io interface)
I’m building a simple REPL using the new std.Io reader/writer interface in Zig 0.16. The loop is supposed to print a prompt, then block waiting for a line of input: const std = @import("std"); const Io = std.Io; pub fn main(init: std.process.Init) !void { const arena: std.mem.Allocator = init.arena.allocator(); const io = init.io; _ = try init.minimal.args.toSlice(arena); var stdout_buffer: [1024]u8 = undefined; var stdout_file_writer: Io.File.Writer = .init(.stdout(), io, &...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.