From 64a3e5a6049fa0489ec3e303e48012fd4bd7317a Mon Sep 17 00:00:00 2001 From: Robert McMahon Date: Fri, 3 Apr 2026 13:39:55 -0700 Subject: [PATCH] cli: emit fiwi: start only when stderr is a TTY. Avoids interleaving the banner with captured stdout (e.g. SSH port-metrics-json and check_concentrator table output). Made-with: Cursor --- fiwi/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fiwi/cli.py b/fiwi/cli.py index 47f2a80..618a986 100644 --- a/fiwi/cli.py +++ b/fiwi/cli.py @@ -206,7 +206,9 @@ def main() -> int: if rc_ssh_map is not None: return rc_ssh_map - os.write(2, b"fiwi: start\n") + # Skip when stderr is a pipe (SSH capture, subprocess): avoids interleaving with stdout consumers. + if sys.stderr.isatty(): + os.write(2, b"fiwi: start\n") try: load_brainstem() except Exception as exc: