From 34464c0db326b2daf9343925dde435073aa8ee68 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Mon, 22 Sep 2025 18:52:23 -0400 Subject: [PATCH] tui: fix command autocomplete to show for all sessions and adjust message layout --- .../src/cli/cmd/tui/component/prompt.tsx | 20 +++++++++---------- packages/opencode/src/cli/cmd/tui/session.tsx | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt.tsx index 9fade8f45..61faa8c6e 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt.tsx @@ -307,17 +307,17 @@ function Autocomplete(props: { const results: AutocompleteOption[] = [] const s = session() const dialog = useDialog() + for (const command of sync.data.command) { + results.push({ + display: "/" + command.name, + description: command.description, + onSelect: () => { + props.input().value = "/" + command.name + " " + props.input().cursorPosition = props.input().value.length + }, + }) + } if (s) { - for (const command of sync.data.command) { - results.push({ - display: "/" + command.name, - description: command.description, - onSelect: () => { - props.input().value = "/" + command.name + " " - props.input().cursorPosition = props.input().value.length - }, - }) - } results.push( { display: "/undo", diff --git a/packages/opencode/src/cli/cmd/tui/session.tsx b/packages/opencode/src/cli/cmd/tui/session.tsx index 46bb41d2a..f2548c149 100644 --- a/packages/opencode/src/cli/cmd/tui/session.tsx +++ b/packages/opencode/src/cli/cmd/tui/session.tsx @@ -192,7 +192,7 @@ function TextPart(props: { part: TextPart; message: AssistantMessage }) { const local = useLocal() return ( - + {props.part.text.trim()} {Locale.titlecase(agent().name)}{" "}