Description
In opencode v1.17.3+, pressing Ctrl+C to copy selected text in the TUI causes Windows Terminal's tab title to reset from the session title to "Windows PowerShell". The title does not recover on new messages, only on session rename (Ctrl+R) or route switch (Home -> Session). Downgrading to v1.16.2 resolves the issue entirely.
Environment
- OS: Windows 11
- Terminal: Windows Terminal 1.24.11321.0
- Shell: PowerShell 7 (pwsh.exe)
- OpenCode version: v1.17.3 through v1.17.6 (confirmed not fixed)
- Profile: cmd.exe /c opencode via WT profile
Steps to Reproduce
- Start opencode in Windows Terminal
- Wait for TUI to load (tab title shows session title, e.g. "OC | ...")
- Mouse-select any text in the chat area
- Press Ctrl+C to copy
- Tab title immediately changes to "Windows PowerShell"
- Sending a new message does not restore the title
- Only Ctrl+R (rename session) or Ctrl+P to Home then back to Session restores it
Root Cause Analysis
The title is set via OpenTUI's renderer.setTerminalTitle() which outputs OSC 0 escape sequence. On Ctrl+C copy, something triggers a title reset. Windows Terminal falls back to startingTitle ("Windows PowerShell") either because an empty title is emitted or the OSC 0 sequence is not reaching ConPTY correctly.
Introduced between v1.16.2 and v1.17.3. The ConPTY rewrite in WT v1.22 may be a compounding factor but is not the root cause (v1.16.2 works fine on the same WT version).
Workaround
Downgrade to v1.16.2: npm install -g opencode-ai@1.16.2
Or set suppressApplicationTitle: true in the WT profile (disables all app-driven title changes).
Related
Description
In opencode v1.17.3+, pressing Ctrl+C to copy selected text in the TUI causes Windows Terminal's tab title to reset from the session title to "Windows PowerShell". The title does not recover on new messages, only on session rename (Ctrl+R) or route switch (Home -> Session). Downgrading to v1.16.2 resolves the issue entirely.
Environment
Steps to Reproduce
Root Cause Analysis
The title is set via OpenTUI's renderer.setTerminalTitle() which outputs OSC 0 escape sequence. On Ctrl+C copy, something triggers a title reset. Windows Terminal falls back to startingTitle ("Windows PowerShell") either because an empty title is emitted or the OSC 0 sequence is not reaching ConPTY correctly.
Introduced between v1.16.2 and v1.17.3. The ConPTY rewrite in WT v1.22 may be a compounding factor but is not the root cause (v1.16.2 works fine on the same WT version).
Workaround
Downgrade to v1.16.2: npm install -g opencode-ai@1.16.2
Or set suppressApplicationTitle: true in the WT profile (disables all app-driven title changes).
Related