diff --git a/packages/opencode/src/cli/cmd/tui/component/border.tsx b/packages/opencode/src/cli/cmd/tui/component/border.tsx index 9cbb96068..333071020 100644 --- a/packages/opencode/src/cli/cmd/tui/component/border.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/border.tsx @@ -1,16 +1,21 @@ +export const EmptyBorder = { + topLeft: "", + bottomLeft: "", + vertical: "", + topRight: "", + bottomRight: "", + horizontal: " ", + bottomT: "", + topT: "", + cross: "", + leftT: "", + rightT: "", +} + export const SplitBorder = { border: ["left" as const, "right" as const], customBorderChars: { - topLeft: "", - bottomLeft: "", + ...EmptyBorder, vertical: "┃", - topRight: "", - bottomRight: "", - horizontal: "", - bottomT: "", - topT: "", - cross: "", - leftT: "", - rightT: "", }, } diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 8281ab617..c74b3da8b 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -9,10 +9,10 @@ import { fg, type KeyBinding, } from "@opentui/core" -import { createEffect, createMemo, Match, Switch, type JSX, onMount } from "solid-js" +import { createEffect, createMemo, Match, Switch, type JSX, onMount, createSignal, onCleanup, Show } from "solid-js" import { useLocal } from "@tui/context/local" import { useTheme } from "@tui/context/theme" -import { SplitBorder } from "@tui/component/border" +import { EmptyBorder, SplitBorder } from "@tui/component/border" import { useSDK } from "@tui/context/sdk" import { useRoute } from "@tui/context/route" import { useSync } from "@tui/context/sync" @@ -29,6 +29,8 @@ import { Clipboard } from "../../util/clipboard" import type { FilePart } from "@opencode-ai/sdk" import { TuiEvent } from "../../event" import { iife } from "@/util/iife" +import { Locale } from "@/util/locale" +import { Shimmer } from "../../ui/shimmer" export type PromptProps = { sessionID?: string @@ -57,7 +59,7 @@ export function Prompt(props: PromptProps) { const sdk = useSDK() const route = useRoute() const sync = useSync() - const status = createMemo(() => (props.sessionID ? sync.session.status(props.sessionID) : "idle")) + const status = createMemo(() => sync.data.session_status[props.sessionID ?? ""] ?? { type: "idle" }) const history = usePromptHistory() const command = useCommandDialog() const renderer = useRenderer() @@ -542,6 +544,16 @@ export function Prompt(props: PromptProps) { return } + const highlight = createMemo(() => { + if (keybind.leader) return theme.accent + if (store.mode === "shell") return theme.primary + return local.agent.color(local.agent.current().name) + }) + + createEffect(() => { + renderer.setCursorColor(highlight()) + }) + return ( <> (anchor = r)}> - - - {store.mode === "normal" ? ">" : "!"} - - - +