From c3906da78158dfb19d23d3dfc2f9f37b1bee7cab Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 4 May 2026 16:28:47 +0200 Subject: [PATCH] cli (base): Flush output on `self.disp`: When `li` stdout was redirected (e.g. with a pipe), the buffer was preventing to display immediately data, which is a problem when we need it immediately (like when monitoring with `li debug monitor`). Flushing is now done immediately to avoid that. --- libervia/cli/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libervia/cli/base.py b/libervia/cli/base.py index 823ef52c..c6a27895 100644 --- a/libervia/cli/base.py +++ b/libervia/cli/base.py @@ -326,9 +326,9 @@ class LiberviaCli: """ if self.verbosity >= verbosity: if error: - print(msg, end=end, file=sys.stderr) + print(msg, end=end, file=sys.stderr, flush=True) else: - print(msg, end=end) + print(msg, end=end, flush=True) async def output(self, type_, name, extra_outputs, data): if name in extra_outputs: