Copy-on-select in screen-5.0 in macOS/iTerm writes characters over input field #8827

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

Originally created by @mikaelj on GitHub (Feb 8, 2026).

Originally assigned to: @kommander on GitHub.

Description

As described. Sometimes it's lots of text, sometimes it's just tmux;

.screenrc in use:

  startup_message       off             # default: on
bell_msg ""

  obuflimit             20485760 # 10m should be enough.
  defflow               off
  msgwait               0

  defscrollback         10000            # default: 100
  hardcopydir           $HOME/.hardcopy

  shell                 bash

  msgwait 1
  msgminwait 1

  bind l focus right
  bind h focus left
  bind j focus down
  bind k focus up
  bind t focus top
  bind b focus bottom

  escape ^zz

attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
caption always "%{= 7;0}%-w %{= 0;7} %n %t %{-} %+w%=%S @ %H (%C)"

term screen-256color

truecolor on
defbce "on" 
defflow off

termcapinfo xterm-256color 'Co#256:pa#32767'
termcapinfo xterm-256color 'AB=\E[48;5;%dm'
attrcolor b ".I"
termcapinfo xterm     ti@:te@

bindkey -m "^[[5;2~" stuff ^u
bindkey -m "^[[6;2~" stuff ^d


bindkey -k "#4" prev # shift left
bindkey -k "%i" next # shift right
defutf8 on

Plugins

No response

OpenCode version

1.1.53

Steps to reproduce

  1. start screen (install 5.0 from homebrew)
  2. start opencode
  3. select text on the screen
  4. et voila - see screenshot.

The text "tmux;" is not inserted into the textfield - if I type it gets overwritten.
The selected text is copied.

Screenshot and/or share link

Image

Operating System

macOS 15.7.1

Terminal

iTerm2

Originally created by @mikaelj on GitHub (Feb 8, 2026). Originally assigned to: @kommander on GitHub. ### Description As described. Sometimes it's lots of text, sometimes it's just tmux; .screenrc in use: ``` startup_message off # default: on bell_msg "" obuflimit 20485760 # 10m should be enough. defflow off msgwait 0 defscrollback 10000 # default: 100 hardcopydir $HOME/.hardcopy shell bash msgwait 1 msgminwait 1 bind l focus right bind h focus left bind j focus down bind k focus up bind t focus top bind b focus bottom escape ^zz attrcolor b ".I" termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' caption always "%{= 7;0}%-w %{= 0;7} %n %t %{-} %+w%=%S @ %H (%C)" term screen-256color truecolor on defbce "on" defflow off termcapinfo xterm-256color 'Co#256:pa#32767' termcapinfo xterm-256color 'AB=\E[48;5;%dm' attrcolor b ".I" termcapinfo xterm ti@:te@ bindkey -m "^[[5;2~" stuff ^u bindkey -m "^[[6;2~" stuff ^d bindkey -k "#4" prev # shift left bindkey -k "%i" next # shift right defutf8 on ``` ### Plugins _No response_ ### OpenCode version 1.1.53 ### Steps to reproduce 1. start screen (install 5.0 from homebrew) 2. start opencode 3. select text on the screen 4. et voila - see screenshot. The text "tmux;" is not inserted into the textfield - if I type it gets overwritten. The selected text _is_ copied. ### Screenshot and/or share link <img width="364" height="85" alt="Image" src="https://github.com/user-attachments/assets/0ea64c8b-43fd-45c1-8f5b-7f31a47e85c2" /> ### Operating System macOS 15.7.1 ### Terminal iTerm2
yindo added the opentuibug labels 2026-02-16 18:10:57 -05:00
Author
Owner

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

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

  • #9942: Copy-on-Select fails when running opencode via Tmux in Kitty terminal (Linux) - similar copy-on-select functionality issue with terminal multiplexers
  • #12082: Clipboard copy fails in Zellij and other multiplexers (OSC52 written to stdout instead of /dev/tty) - related to clipboard/copy issues with terminal multiplexers like screen
  • #12003: Copy & Newline Not Working in macOS Default Terminal - similar text input/clipboard issues on macOS terminals
  • #10490: [Feature Request] Add config option to disable copy-on-select behavior - discusses copy-on-select behavior and its side effects

Feel free to ignore if this specific copy-on-select behavior with screen 5.0 in iTerm2 differs from these existing issues.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue might be a duplicate of existing issues. Please check: - #9942: Copy-on-Select fails when running opencode via Tmux in Kitty terminal (Linux) - similar copy-on-select functionality issue with terminal multiplexers - #12082: Clipboard copy fails in Zellij and other multiplexers (OSC52 written to stdout instead of /dev/tty) - related to clipboard/copy issues with terminal multiplexers like screen - #12003: Copy & Newline Not Working in macOS Default Terminal - similar text input/clipboard issues on macOS terminals - #10490: [Feature Request] Add config option to disable copy-on-select behavior - discusses copy-on-select behavior and its side effects Feel free to ignore if this specific copy-on-select behavior with screen 5.0 in iTerm2 differs from these existing issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8827