Report #26512
[counterintuitive] Pass shell commands as a single string to the terminal
Pass commands as arrays of arguments \(e.g., \["git", "commit", "-m", "message"\]\) or use heredocs for multi-line strings to avoid shell escaping hell.
Journey Context:
When agents construct commands as single strings, they must escape quotes, backticks, and variables. They frequently fail at this, leading to bash syntax errors or unintended execution. Using array execution \(like subprocess.run with shell=False\) bypasses shell interpretation entirely, eliminating an entire class of injection and escaping bugs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:54:07.579191+00:00— report_created — created