From 0689101e7232b7ada31be03f8c5405935e7c7f2b Mon Sep 17 00:00:00 2001 From: retoor Date: Fri, 21 Mar 2025 08:19:41 +0000 Subject: [PATCH] feat: add real-time stdout printing during terminal command execution in tools.h The change inserts a `printf("%s", output)` call inside the `tool_function_linux_terminal` function, immediately after reallocating the output buffer and before appending new data. This enables real-time display of captured process output to the console as chunks are received, rather than only returning the final aggregated string. The modification affects the core execution loop in `tools.h` where command output is accumulated from the process stream. --- tools.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools.h b/tools.h index 92cb783..b7c9012 100644 --- a/tools.h +++ b/tools.h @@ -77,6 +77,7 @@ char* tool_function_linux_terminal(char* command) { return strdup("Failed to allocate memory!"); } output = new_output; + printf("%s", output); strcpy(output + total_size, buffer); total_size += chunk_size; }