From 27ec425ed3b468483ebe5f1f39017a51bc015622 Mon Sep 17 00:00:00 2001 From: Pierre Guilleminot Date: Sat, 17 Oct 2026 00:53:48 +0200 Subject: [PATCH] fix(tui): show default exec command workdir --- internal/tui/chat/render_test.go | 2 +- internal/tui/chat/tool.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/tui/chat/render_test.go b/internal/tui/chat/render_test.go index 3f91582b..add56372 100644 --- a/internal/tui/chat/render_test.go +++ b/internal/tui/chat/render_test.go @@ -315,7 +315,7 @@ func TestExecCommandPreservesSafeBoundedMultilineInvocation(t *testing.T) { plain := ansi.Strip(RenderBlock(block, 32, DefaultStyles(true), 0)) want := strings.Join([]string{ - "✓ ran python3 - <<'PY'", + "✓ ran python3 - <<'PY' in .", " │ import json", " │ print('long command line th…", " │ … +4 lines", diff --git a/internal/tui/chat/tool.go b/internal/tui/chat/tool.go index 604635f0..29b4c45f 100644 --- a/internal/tui/chat/tool.go +++ b/internal/tui/chat/tool.go @@ -216,6 +216,9 @@ func classifyTool(tool *agent.ToolBlock) toolPresentation { if decodeObject(input, &in) && in.Cmd != "" { // Preserve command line boundaries for the exec-specific renderer. The // working directory remains compact metadata in the header. + if in.Workdir == "" { + in.Workdir = "." + } p.argument, p.context = escape.Multiline(in.Cmd), escape.SingleLine(in.Workdir) if in.TimeoutMS != nil && *in.TimeoutMS > 0 && *in.TimeoutMS <= spec.ExecMaxTimeoutMS { p.timeout = (time.Duration(*in.TimeoutMS) * time.Millisecond).String()