From a8a568618e66b21ac8ad13a50952509bcc9eab56 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 20 Nov 2025 13:50:36 -0700 Subject: [PATCH] boot-qemu.py: Flush the qemu command print to ensure proper ordering When writing boot-qemu.py output to a file, the command print will end up at the end, rather than in the spot where it should be if it was running interactively. Flush the IO buffers before running QEMU to ensure the print is consistently where it should be. Signed-off-by: Nathan Chancellor --- boot-qemu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot-qemu.py b/boot-qemu.py index a592046..1426933 100755 --- a/boot-qemu.py +++ b/boot-qemu.py @@ -185,7 +185,8 @@ def _run_fg(self): qemu_cmd += [self._qemu_path, *self._qemu_args] - print(f"$ {' '.join(shlex.quote(str(elem)) for elem in qemu_cmd)}") + print(f"$ {' '.join(shlex.quote(str(elem)) for elem in qemu_cmd)}", + flush=True) try: subprocess.run(qemu_cmd, check=True) except subprocess.CalledProcessError as err: