[PR #8884] fix(tui): handle --prompt flag when used with --continue (#8850) #12900

Open
opened 2026-02-16 18:17:47 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8884

State: open
Merged: No


What does this PR do?

Fixes #8850 - Makes --continue --prompt flags work together.

Problem: When using opencode --continue --prompt "message", the prompt was ignored because:

--continue navigates directly to the session route (app.tsx:267-275)
--prompt was only handled in home.tsx:84-87, which never runs when continuing a session

How did you verify your code works?

Solution: Added args.prompt handling to
session/index.tsx
so when a user continues a session with a prompt, it:

Waits for sync to complete loading
Sets the prompt text
Automatically submits it
Change:

Added useArgs import to
session/index.tsx
Extended the existing createEffect for initialPrompt to also handle args.prompt
Added guard to prevent multiple submissions
How did you verify your code works?
Code review confirmed the fix follows the same pattern as home.tsx:84-87
The sync.status !== "loading" check ensures the session is ready before submitting
The initialPromptHandled guard prevents duplicate submissions from reactive effects

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8884 **State:** open **Merged:** No --- ### What does this PR do? Fixes #8850 - Makes --continue --prompt flags work together. Problem: When using opencode --continue --prompt "message", the prompt was ignored because: --continue navigates directly to the session route (app.tsx:267-275) --prompt was only handled in home.tsx:84-87, which never runs when continuing a session ### How did you verify your code works? Solution: Added args.prompt handling to session/index.tsx so when a user continues a session with a prompt, it: Waits for sync to complete loading Sets the prompt text Automatically submits it Change: Added useArgs import to session/index.tsx Extended the existing createEffect for initialPrompt to also handle args.prompt Added guard to prevent multiple submissions How did you verify your code works? Code review confirmed the fix follows the same pattern as home.tsx:84-87 The sync.status !== "loading" check ensures the session is ready before submitting The initialPromptHandled guard prevents duplicate submissions from reactive effects
yindo added the pull-request label 2026-02-16 18:17:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12900