Prompt input content is lost when changing sessions via command dialog more than once #8576

Open
opened 2026-02-16 18:10:18 -05:00 by yindo · 1 comment
Owner

Originally created by @WaryaWayne on GitHub (Feb 5, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When switching sessions through the command dialog (Ctrl+P) with text in the input box, the prompt preservation only works for the first session change. Subsequent session switches lose the input content.

Expected Behaviour
Text in the input box should be preserved every time a user switches to a new session via the command dialog.

Actual Behaviour
First session switch: Text is correctly preserved in the input box.

Second and subsequent switches: Text is lost and not carried over to the new session

Link to PR: https://github.com/anomalyco/opencode/pull/12235

link to tweet with a video showing the issue and fix: https://x.com/WaryaWayne/status/2019289790991200269

Plugins

n/a

OpenCode version

1.1.51

Steps to reproduce

  • Start a new opencode instance
  • Send a chat message, then type a new prompt in the input box
  • Use the command dialog (Ctrl+P) to switch to a new session
  • Observe: Your prompt is still in the input box
  • Navigate back to the original session
  • Observe: Your text is still there
  • Problem: Switch sessions again via command dialog
  • Observe: Your message is now lost and only available in the session where you originally typed it

Screenshot and/or share link

link to tweet with a video showing the issue and fix: https://x.com/WaryaWayne/status/2019289790991200269

Operating System

MacOS

Terminal

Ghostty

Originally created by @WaryaWayne on GitHub (Feb 5, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When switching sessions through the command dialog (Ctrl+P) with text in the input box, the prompt preservation only works for the first session change. Subsequent session switches lose the input content. Expected Behaviour Text in the input box should be preserved every time a user switches to a new session via the command dialog. Actual Behaviour First session switch: Text is correctly preserved in the input box. Second and subsequent switches: Text is lost and not carried over to the new session Link to PR: https://github.com/anomalyco/opencode/pull/12235 link to tweet with a video showing the issue and fix: https://x.com/WaryaWayne/status/2019289790991200269 ### Plugins n/a ### OpenCode version 1.1.51 ### Steps to reproduce - Start a new opencode instance - Send a chat message, then type a new prompt in the input box - Use the command dialog (Ctrl+P) to switch to a new session - Observe: Your prompt is still in the input box - Navigate back to the original session - Observe: Your text is still there - Problem: Switch sessions again via command dialog - Observe: Your message is now lost and only available in the session where you originally typed it ### Screenshot and/or share link link to tweet with a video showing the issue and fix: https://x.com/WaryaWayne/status/2019289790991200269 ### Operating System MacOS ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:10:18 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11699: Race condition in session prompt state management - could be the root cause affecting input state during session switches
  • #11922: Text duplication/persistence issues when switching sessions - related text handling problem during session changes
  • #10638: Input field disappears during state transitions - UI state issue that might be related

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #11699: Race condition in session prompt state management - could be the root cause affecting input state during session switches - #11922: Text duplication/persistence issues when switching sessions - related text handling problem during session changes - #10638: Input field disappears during state transitions - UI state issue that might be related Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8576