Compare commits

...

4 Commits

Author SHA1 Message Date
Kit Langton 13ef9924fa fix(tui): preserve shell status spacing 2026-07-14 19:13:50 +00:00
Kit Langton 746f941b40 fix(tui): space background shell status 2026-07-14 19:13:50 +00:00
Kit Langton 4df54601df fix(tui): pad background shell status 2026-07-14 19:13:50 +00:00
Kit Langton e2614f2be4 fix(tui): keep background shell status inline 2026-07-14 19:13:50 +00:00
+25 -20
View File
@@ -2327,11 +2327,13 @@ function Shell(props: ToolProps) {
const [expanded, setExpanded] = createSignal(false) const [expanded, setExpanded] = createSignal(false)
const maxLines = 10 const maxLines = 10
const maxChars = createMemo(() => maxLines * Math.max(20, ctx.width - 6)) const maxChars = createMemo(() => maxLines * Math.max(20, ctx.width - 6))
const input = createMemo(() => (command() ? `${isRunning() ? "" : "$ "}${command()}` : "")) const input = createMemo(() => {
const content = createMemo(() => [input(), output()].filter(Boolean).join("\n\n")) const value = command()?.replace(/\s+/g, " ").trim()
const collapsed = createMemo(() => collapseToolOutput(content(), maxLines, maxChars())) return value ? `${isRunning() ? "" : "$ "}${value}` : ""
})
const collapsed = createMemo(() => collapseToolOutput(output(), maxLines, maxChars()))
const limited = createMemo(() => { const limited = createMemo(() => {
if (expanded() || !collapsed().overflow) return content() if (expanded() || !collapsed().overflow) return output()
return collapsed().output return collapsed().output
}) })
@@ -2348,23 +2350,26 @@ function Shell(props: ToolProps) {
) )
} }
> >
<Show <box flexDirection="row" minWidth={0} paddingRight={1}>
when={isRunning()} <Show when={isRunning()}>
fallback={ <box flexDirection="row" flexShrink={0}>
<text> <Spinner color={color()} />
<span style={{ fg: theme.text }}>{limited().slice(0, input().length)}</span> <text>{"\u00a0"}</text>
<span style={{ fg: theme.textMuted }}>{limited().slice(input().length)}</span> </box>
</text> </Show>
} <text flexShrink={1} wrapMode="none" truncate fg={theme.text}>
> {input()}
<Spinner color={color()}> </text>
<span style={{ fg: theme.text }}>{limited().slice(0, input().length)}</span> <Show when={shellID()}>
<span style={{ fg: theme.textMuted }}>{limited().slice(input().length)}</span> <box flexDirection="row" flexShrink={0}>
</Spinner> <text>{"\u00a0"}</text>
</Show> <StatusBadge>Background</StatusBadge>
</box>
</Show>
</box>
</Show> </Show>
<Show when={shellID()}> <Show when={limited()}>
<StatusBadge>Background</StatusBadge> <text fg={theme.textMuted}>{limited()}</text>
</Show> </Show>
<Show when={collapsed().overflow}> <Show when={collapsed().overflow}>
<text fg={theme.textMuted}>{expanded() ? "Click to collapse" : "Click to expand"}</text> <text fg={theme.textMuted}>{expanded() ? "Click to collapse" : "Click to expand"}</text>