Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/opencode/src/cli/cmd/tui/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ export function Home() {
</Show>
)

let prompt: PromptRef
let prompt: PromptRef | undefined
const args = useArgs()
onMount(() => {
const initPrompt = () => {
if (once) return
if (!prompt) return
if (route.initialPrompt) {
prompt.set(route.initialPrompt)
once = true
Expand All @@ -86,7 +87,8 @@ export function Home() {
once = true
prompt.submit()
}
})
}

const directory = useDirectory()

const keybind = useKeybind()
Expand All @@ -101,6 +103,7 @@ export function Home() {
ref={(r) => {
prompt = r
promptRef.set(r)
initPrompt()
}}
hint={Hint}
/>
Expand Down