From 901d589f41094a5f8f6086ea346fb952983df202 Mon Sep 17 00:00:00 2001 From: Thomas Calmant Date: Thu, 10 Jul 2025 11:49:34 +0200 Subject: [PATCH] Print remote shell traces to stderr Avoids having issues when using a Remote Shell in an MCP server using the stdio transport (stdin/stdout) --- pelix/shell/remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelix/shell/remote.py b/pelix/shell/remote.py index 6e8e6ffb..ef3d6b0e 100644 --- a/pelix/shell/remote.py +++ b/pelix/shell/remote.py @@ -720,7 +720,7 @@ def main(argv: Optional[List[str]] = None) -> int: try: if args.no_input: # No input required: just print the access to the shell - print("Remote shell bound to:", host, "- port:", port) + print("Remote shell bound to:", host, "- port:", port, file=sys.stderr) try: while not framework.wait_for_stop(1): @@ -728,7 +728,7 @@ def main(argv: Optional[List[str]] = None) -> int: # exception to raise pass except KeyboardInterrupt: - print("Got Ctrl+C: exiting.") + print("Got Ctrl+C: exiting.", file=sys.stderr) return 127 else: # Prepare interpreter variables