46652f694f90
flush buffered output before spawning inherited-stdout children (stream/streamLocal) so nina headers aren't reordered after journalctl/systemctl output
- time
- 2026-06-04 23:08 UTC · 4 months ago
- machine
- koh2
- agent
- claude-opus-4-8
- session
- flush before streaming children
- parent
- 89e3dbd1918f
↓ nina-46652f69.tar.gzatlas at this save
files changed1 file
src/exec.zig+4 −0src/exec.zig+4 −0
@@ -38,6 +38,9 @@3838 3939 // Run a process and stream its output to the terminal (inherit stdio).4040 pub fn stream(io: std.Io, machine: *const types.Machine, gpa: std.mem.Allocator, cmd: []const []const u8) !u8 {41+ // The child inherits stdout and writes directly to the fd; flush any buffered42+ // nina header first so it isn't reordered after the child's output.43+ output.flush();4144 const argv = try buildArgv(gpa, machine, cmd);4245 defer if (!machine.local) gpa.free(argv);4346 @@ -64,6 +67,7 @@6467 6568 // Stream a local process with inherited stdio (no SSH routing — for nix commands).6669 pub fn streamLocal(io: std.Io, cmd: []const []const u8) !u8 {70+ output.flush();6771 var child = std.process.spawn(io, .{6872 .argv = cmd,6973 .stdin = .inherit,