opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fix/mouse coordinate selection

Open pepperpepperpepper opened this issue 5 months ago • 4 comments

These changes make mouse text selection in the TUI chat work as expected - like other terminal applications. Users can now select text beyond the viewport with automatic scrolling, and clipboard behavior follows standard Ctrl+C patterns instead of immediate copy on release.

pepperpepperpepper avatar Jul 22 '25 05:07 pepperpepperpepper

Thank you! This solves the text-selection problem for me. Without this PR, trying to select text actually writes text all over the screen. After this PR, I can select text normally without disturbing it.

However, this PR has broken my ability to scroll down after scrolling up. Steps to reproduce: start opencode; resume a session with enough history to require scrolling; scroll up, then try scrolling back down. Only the bottom 5% of the window scrolls back down. Although I didn't actually use opencode yet before applying this PR, I can't seem to reproduce this scroll bug without this PR so I think it's new behavior.

benemorius avatar Jul 22 '25 19:07 benemorius

@benemorius I can't reproduce your error. Are you certain you can't scroll back down?

pepperpepperpepper avatar Jul 22 '25 20:07 pepperpepperpepper

added right click copy into pastebuffer

pepperpepperpepper avatar Jul 27 '25 07:07 pepperpepperpepper

If you're interested in using this pr or patching opencode, just lmk I've merged it into my own working branch "unchained" which has this and some other performance enhancements. Thanks

pepperpepperpepper avatar Jul 29 '25 04:07 pepperpepperpepper