diff --git a/packages/tui/src/routes/session/composer/shell-tab.tsx b/packages/tui/src/routes/session/composer/shell-tab.tsx index 74176374256..aca8089c37b 100644 --- a/packages/tui/src/routes/session/composer/shell-tab.tsx +++ b/packages/tui/src/routes/session/composer/shell-tab.tsx @@ -136,7 +136,7 @@ export function ShellTab(props: { sessionID: string }) { attributes={active() ? TextAttributes.BOLD : undefined} wrapMode="none" > - {shell.command} + {shell.command.split("\n", 1)[0]} ) diff --git a/packages/tui/test/cli/tui/composer-keymap.test.tsx b/packages/tui/test/cli/tui/composer-keymap.test.tsx index 68fd0ae764b..1feb3aa426c 100644 --- a/packages/tui/test/cli/tui/composer-keymap.test.tsx +++ b/packages/tui/test/cli/tui/composer-keymap.test.tsx @@ -23,7 +23,7 @@ const sessions = { "child-b": session("child-b", "Second", "parent"), } -const shells = [shell("sh-a", "bun test"), shell("sh-b", "bun dev")] +const shells = [shell("sh-a", "bun test"), shell("sh-b", "bun dev"), shell("sh-c", "python3 - <<'PY'\nimport json")] async function renderComposer( defaultTab: "subagents" | "shell", @@ -191,6 +191,17 @@ test("disabled shell bindings have no component fallbacks", async () => { } }) +test("shell list shows one line per command", async () => { + const composer = await renderComposer("shell", {}) + try { + const frame = composer.app.captureCharFrame() + expect(frame).toContain("python3 - <<'PY'") + expect(frame).not.toContain("import json") + } finally { + composer.app.renderer.destroy() + } +}) + test("configured composer bindings work with a focused textarea", async () => { const composer = await renderComposer("subagents", { "composer.shell.kill": "ctrl+u" }, true) try {