From b600f44d69d5c87a0f152a5a78bcccd8b1693b02 Mon Sep 17 00:00:00 2001 From: procr1337 <193802945+procr1337@users.noreply.github.com> Date: Mon, 15 Jun 2026 09:03:24 +0200 Subject: [PATCH] agent: Fix shell hang on shell syntax errors with terminal tool usage (#59270) # Objective When the agent's terminal tool runs a command with an unsupported shell syntax (e.g. process substitution `<()` in dash), the shell prints an error and then drops into interactive mode. It shows a `$` prompt and hangs waiting for input, requiring the user to press Ctrl+D to continue. This happens because the stdin redirect wraps the command in a subshell `(...) { - combined_command.insert_str(0, "begin; "); - combined_command.push_str("; end { + combined_command.insert_str(0, "exec { - combined_command.insert_str(0, "begin; "); - combined_command.push_str("; end { + combined_command.insert_str(0, "exec