From e83e22ef5e0cb1b4f31fcf958ec549f564e9e1fb Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Tue, 20 May 2025 15:31:50 +0200 Subject: [PATCH] fix: ensure tmux capture-pane gets full output with -S - -E - flags --- backend/agent/tools/sb_shell_tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/agent/tools/sb_shell_tool.py b/backend/agent/tools/sb_shell_tool.py index bea10729..8fd82caa 100644 --- a/backend/agent/tools/sb_shell_tool.py +++ b/backend/agent/tools/sb_shell_tool.py @@ -154,7 +154,7 @@ class SandboxShellTool(SandboxToolsBase): break # Get current output and check for common completion indicators - output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p") + output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p -S - -E -") current_output = output_result.get("output", "") # Check for prompt indicators that suggest command completion @@ -164,7 +164,7 @@ class SandboxShellTool(SandboxToolsBase): break # Capture final output - output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p") + output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p -S - -E -") final_output = output_result.get("output", "") # Kill the session after capture @@ -274,7 +274,7 @@ class SandboxShellTool(SandboxToolsBase): return self.fail_response(f"Tmux session '{session_name}' does not exist.") # Get output from tmux pane - output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p") + output_result = await self._execute_raw_command(f"tmux capture-pane -t {session_name} -p -S - -E -") output = output_result.get("output", "") # Kill session if requested