From 2593c5bf601fa0b35595dcf911d922d303ac09ed Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Tue, 8 Jul 2025 14:16:37 -0700 Subject: [PATCH] feat(repl): Isolate stdout --- Repl.lean | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Repl.lean b/Repl.lean index 963503b..2574dab 100644 --- a/Repl.lean +++ b/Repl.lean @@ -267,7 +267,10 @@ def execute (command: Protocol.Command): MainM Json := do try match fromJson? command.payload with | .ok args => do - match (← comm args |>.run) with + let (msg, result) ← IO.FS.withIsolatedStreams (isolateStderr := false) $ comm args + if !msg.isEmpty then + IO.eprintln s!"stdout: {msg}" + match result with | .ok result => return toJson result | .error ierror => return toJson ierror | .error error => return toJson $ errorCommand s!"Unable to parse json: {error}"