anomalyco / anomalyco/opencode

tui: typed input in new tab is lost when switching away and back

Open
#47,023 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Sep 3, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

When a new tab is opened in OpenCode and the user switches to a previously-open tab, the new tab closes automatically. While that behavior is expected, any text that was typed into the new tab's input area (before pressing Enter) is permanently lost.

Environment

  • opencode version: opencode2 v0.0.0-beta-18992
  • OS: Linux LP15-DLX1-DSY 6.18.33.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026 x86_64
  • Terminal: Windows Terminal (WSL2); TERM=xterm-256color; TERM_PROGRAM=; COLORTERM=
  • Shell: /bin/bash
  • Install/channel: beta
  • Active plugins: cc-safety-net, opencode-pty

Reproduction

  1. Open OpenCode with at least one existing tab containing a conversation.
  2. Open a new tab.
  3. Type some text into the new tab's input area, but do not press Enter.
  4. Switch to the previous/existing tab.
  5. Observe that the new tab closes automatically.
  6. The text typed in step 3 is gone and cannot be recovered.

Expected Behavior

The auto-closing of an empty/unsubmitted new tab is acceptable, but any unsubmitted text typed into that tab should be preserved (for example, restored when the tab is reopened, or the tab should remain open while it contains user input).

Actual Behavior

The new tab closes and the typed text is permanently lost.

Additional Context

  • Frequency: reproducible every time.
  • Workarounds tried: none.
  • Related (but not duplicate) issues: #14263, #23325, #41705.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.