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
writeOsc52 broken under GNU screen — uses tmux DCS format, no chunking #28590
writeOsc52 in packages/opencode/src/cli/cmd/tui/util/clipboard.ts treats GNU screen and tmux the same way, wrapping both in \x1bPtmux;\x1b...\x1b\\. This was originally reported by @valdemardi in #26491 / #26492 (closed before merging).
The tmux; prefix is specific to tmux. Under screen, it is output verbatim alongside the escape sequences. The embedded OSC52 usually still reaches the clipboard (\x1b]52;c;...\x07 is valid enough), but the tmux; garbage and leaked escape sequences corrupt the terminal output and scramble the TUI display.
Screen also has a 768-byte DCS buffer limit (MAXSTR), so clipboard writes larger than ~750 bytes are silently truncated. Screen requires chunking with \x1b\\\x1bP between segments.
Plugins
N/A
OpenCode version
1.15.6
Steps to reproduce
Run inside a GNU screen session (STY is set)
Try any clipboard copy
Text may reach the clipboard but the TUI display gets corrupted with garbage characters and escape artifacts
Thanks reporting. I'll remove the osc52 specific things from openecode shortly and use OpenTUI directly for this. That should solve the issue since we already;
Distinguishes tmux and GNU Screen.
Use Screen DCS passthrough without the corrupting tmux; prefix.
Thanks reporting. I'll remove the osc52 specific things from openecode shortly and use OpenTUI directly for this. That should solve the issue since we already;
Distinguishes tmux and GNU Screen.
Use Screen DCS passthrough without the corrupting tmux; prefix.
Hi @simonklee - politely asking for when this will happen, so that I can set my own expectations, thanks.
@simonklee While you're at it, I also want to note, that if you run opencode in tmux, inside neovim, opencode also assume the terminal understands tmux passthrough, but will similarly leave garbage in the neovim terminal.
i am using screen to and it is the hell with your tui
first i had to export TERM=screen.xterm-256color
because with only TERM=screen the colors are out of wack and i got black text on black ground which is pity much unreadable
Also i have to always select while pressing the shift key, i tried setting
which dosnt help at all cause the selecting is still your impelmentation and right clicks are blocked still entirely but now enable your copy routine
i had to export OPENCODE_DISABLE_MOUSE=1 for it to work somehow, which seams to also fix the home/end key, so either make this default when you detect screen or fix your clipboard handling in screen sessions...
Activity
lingfish commentedon Jun 4, 2026
Any chance the associated PR can get looked at?
Polite ping to @kommander
simonklee commentedon Jun 18, 2026
Thanks reporting. I'll remove the osc52 specific things from openecode shortly and use OpenTUI directly for this. That should solve the issue since we already;
lingfish commentedon Jun 18, 2026
Awesome, thankyou! Let me know if I should just nuke my PR etc or not.
lingfish commentedon Jun 23, 2026
Hi @simonklee - politely asking for when this will happen, so that I can set my own expectations, thanks.
lingfish commentedon Jul 6, 2026
Just another polite ping.
ferdinandyb commentedon Jul 6, 2026
@simonklee While you're at it, I also want to note, that if you run opencode in tmux, inside neovim, opencode also assume the terminal understands tmux passthrough, but will similarly leave garbage in the neovim terminal.
99742 commentedon Jul 7, 2026
hi there,
i am using screen to and it is the hell with your tui
first i had to
export TERM=screen.xterm-256colorbecause with only
TERM=screenthe colors are out of wack and i got black text on black ground which is pity much unreadableAlso i have to always select while pressing the shift key, i tried setting
export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=1which dosnt help at all cause the selecting is still your impelmentation and right clicks are blocked still entirely but now enable your copy routine
i had to export
OPENCODE_DISABLE_MOUSE=1for it to work somehow, which seams to also fix the home/end key, so either make this default when you detect screen or fix your clipboard handling in screen sessions...99742 commentedon Jul 7, 2026
correction home/end key are still broken
lingfish commentedon Jul 19, 2026
Hi again @simonklee just another polite ping.
lingfish commentedon Aug 5, 2026
Sure would be nice to get this resolved.
core: fix GNU Screen OSC 52 passthrough (#1334)
core: fix GNU Screen OSC 52 passthrough (anomalyco#1334)
lingfish commentedon Sep 3, 2026
This is excellent that this has been addressed in☹️
opentui, but it seems the minimum version isv0.5.4, andopencodeis still building withv0.4.xsimonklee commentedon Sep 3, 2026
https://opencode.ai/v2/docs - we're releasing this soon but if you cannot wait you can get it already.