You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Input text should be per-session: switching sessions should not carry over or lose draft text #14263
When you type text in the input box on a session and then switch to another session (via session list or new session), the text either carries over to the new session or gets lost. Instead, each session should maintain its own independent input buffer — switching away should save the draft, and switching back should restore it.
Expected Behavior
Type text in the input box on Session A
Switch to Session B → Session B should have an empty input (or its own previously saved draft)
Switch back to Session A → the text you typed should still be there
Each session should have its own independent input state, similar to how tabs work in a text editor.
Actual Behavior
Text typed in one session either carries over to the next session (polluting it) or is lost entirely
There is no per-session input state — the input buffer is shared globally
Steps to Reproduce
Start opencode, create or open a session (Session A)
Type some text in the input box (but don't send it)
Switch to a different session (Session B) via Ctrl+P → session list
Observe: the text from Session A either appeared in Session B or was lost
Switch back to Session A
Observe: the draft text is gone
Additional Context
The Prompt component uses a single store for input state. When props.sessionID changes, only the placeholder is updated — the input text is not saved or restored per session. An in-memory Map<sessionID, PromptInfo> could be used to save/restore input state on session switches.
This seems like undesirable behaviour. Your reproduction steps describes precisely what I would do if I had initially accidentally typed my input in the wrong session. Upon accidentally typing input into the wrong session, it is convenient to be able to easily carry that input over to the correct session.
Activity
github-actions commentedon Feb 19, 2026
This issue might be a duplicate of existing issues. Please check:
If these cover the same underlying need, consider commenting on the existing issue instead or linking them.
ariane-emory commentedon Feb 19, 2026
This seems like undesirable behaviour. Your reproduction steps describes precisely what I would do if I had initially accidentally typed my input in the wrong session. Upon accidentally typing input into the wrong session, it is convenient to be able to easily carry that input over to the correct session.
uriva commentedon Feb 20, 2026
I think the repro steps are a bit confusing - the text should persist per session, even if you close opencode.
What I'm describing is the standard behaviour in all text UI I can think of: whatsapp, vscode copilot chats, chrome address bar, ubuntu terminal...
The current nonstandard behaviour made me type wrong input in wrong sessions often.
If you type in the wrong session as you described, you should have a shortctut copy all text, then delete all text so you can esasily fix this.
Also sometimes you write some thought to yourself but don't want to queue them yet, and these are obviously per session.
fix: preserve per-session input drafts when switching sessions
web: Clear stale submitted prompts on session load
github-actions commentedon Apr 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.