Welcome to Ziggit, @WeeBull !
One thing I see here is that you are using std.debug.print which is not equivalent to printf/fprintf. It has a lot more going on behind the scenes.
You probably want to get std.fs.File.stdout() or std.fs.File.stderr() and use that file to write your output. You can use the functions on File directly, or get a Writer and use that interface for printing. If you do the Writer, don’t forget to flush()!
Example:
const stdout = std.fs.File.stdout();
var stdout_buf: [256]u8 = undefined; // Can make buffer as big or as small as needed.
var writer = stdout.writer(&stdout_buf);
// Later on
try writer.interface.print("Something that needs {d} formatting", .{10});
// Don't forget
try writer.interface.flush();