Description
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
Screenshot and/or share link
N/A
Operating System
Linux
Terminal
Alacritty and GNU screen v5
Description
writeOsc52inpackages/opencode/src/cli/cmd/tui/util/clipboard.tstreats 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;...\x07is valid enough), but thetmux;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\\\x1bPbetween segments.Plugins
N/A
OpenCode version
1.15.6
Steps to reproduce
STYis set)Screenshot and/or share link
N/A
Operating System
Linux
Terminal
Alacritty and GNU screen v5