Since you redirect both stdout and stderr to a pipe and capture it together, both should be linebuffered to produce nice output. Here is a PoC: ```lua local ffi = require('ffi') ffi.cdef([[ typedef struct __IO_FILE FILE; void setlinebuf(FILE *stream); FILE *stdout; FILE *stderr; ]]) ffi.C.setlinebuf(ffi.C.stdout) ffi.C.setlinebuf(ffi.C.stderr) ```