diff --git a/src/main.zig b/src/main.zig index b65b666..d3ebcb4 100644 --- a/src/main.zig +++ b/src/main.zig @@ -61,6 +61,8 @@ pub const allocator = std.mem.Allocator{ }, }; +pub var io: std.Io = undefined; + // Custom panic impl to reset the terminal before spewing out an error message. pub const panic = std.debug.FullPanic(struct { @@ -331,7 +333,7 @@ fn tryReadArgsFile(path: [:0]const u8) void { defer f.close(); var line_buf: [4096]u8 = undefined; - var line_rd = util.LineReader.init(f, &line_buf); + var line_rd = util.LineReader.init(io, f, &line_buf); while (true) { const line_ = (line_rd.read() catch |e| @@ -464,6 +466,7 @@ fn readImport(path: [:0]const u8) !void { } pub fn main(init: std.process.Init) void { + io = init.io; ui.main_thread = std.Thread.getCurrentId(); // Grab thousands_sep from the current C locale.