fix(herdr): guard idle-pane env wrapping on explicit env_flags in new-session

- Prevent injecting 'env HERDR_WORKSPACE_ID=...' into final_cmd when caller passed no environment variables
- Avoid argument parse errors in real agent binaries (e.g. grok, agy) when reusing an idle pane in new-session
This commit is contained in:
Godopu committed 2026-09-05 21:01:18 +09:00
1 parent 4d11308497
commit de0a9c2e81
1 file changed
+1 -1
+1 -1
View File
@@ -740,7 +740,7 @@ except Exception:
if [ -n "$idle_pane" ]; then if [ -n "$idle_pane" ]; then
target_pane="$idle_pane" target_pane="$idle_pane"
if [ -n "$final_cmd" ]; then if [ -n "$env_flags" ] && [ -n "$final_cmd" ]; then
idle_env="${env_flags//--env /}" idle_env="${env_flags//--env /}"
idle_env="${idle_env:+$idle_env }HERDR_WORKSPACE_ID=$existing_ws" idle_env="${idle_env:+$idle_env }HERDR_WORKSPACE_ID=$existing_ws"
final_cmd="env $idle_env $final_cmd" final_cmd="env $idle_env $final_cmd"