GeezerVison is showing github.com — feat: Copy Mode for OpenCode · Issue #2755 · anomalyco/opencode
feat: Copy Mode for OpenCode #2755DescriptionSummary
OpenCode currently lacks a proper copy mode, making it difficult for users to selectively copy text from chat
messages, code blocks, and other content displayed in the viewport. While basic message copying exists (ctrl+x y), users need vim/tmux-like copy mode for precise text selection and copying.
Problem Statement
Current Limitations
- No Keyboard-based Text Selection: Users cannot select text using keyboard only
- Limited Copy Functionality: Only entire message copying is available (
ctrl+x y)
- Incompatible with tmux Copy Mode: OpenCode runs as a TUI application but doesn't integrate with tmux's copy
mode
- Poor UX for Code Review: Cannot selectively copy code snippets, error messages, or specific parts of
responses
- Mouse Dependency: Users must rely on mouse for text selection, which is inefficient in terminal
environments
User Impact
- Developers: Cannot quickly copy code snippets from AI responses
- Power Users: Keyboard-driven workflow is broken when needing to copy text
- Terminal Enthusiasts: Expect vim/tmux-like navigation and selection
- Accessibility: Mouse-dependent selection is not accessible to all users
Why Copy Mode is Essential
1. Terminal Workflow Compatibility
OpenCode is a TUI (Terminal User Interface) application that runs in terminal emulators. Terminal users expect:
- Vim-like navigation and selection
- Keyboard-driven text manipulation
- Integration with existing terminal tools
2. tmux Integration Problem
When OpenCode runs inside tmux:
- tmux's copy mode (
prefix+[) doesn't work properly, it only can select and copy one page that currently visible of opencode.
3. Pager-like Applications Need Copy Mode
OpenCode functions as a pager for chat messages and code:
- Similar to
less, more, or vim
- All major pagers have copy/select functionality
- Users expect to be able to select and copy content
4. Developer Productivity
Developers using OpenCode need to:
- Copy code snippets from AI responses
- Select error messages for debugging
- Extract specific parts of long responses
- Maintain keyboard-driven workflow
What Already Exists (✅)
- Selection System:
type selection struct {
startX int
endX int
startY int
endY int
}
• Mouse-based selection is implemented
• Coordinate tracking works correctly
2. Highlight System:
```go
type highlightInfo struct {
lineStart, lineEnd int
lines map[int][2]int
}
• Viewport has robust highlighting
• Multi-line highlighting supported
• SetHighlights(), HighlightNext(), HighlightPrevious() available
3. Navigation Keymap:
type KeyMap struct {
PageDown, PageUp key.Binding
HalfPageUp, HalfPageDown key.Binding
Down, Up key.Binding
Left, Right key.Binding
}
• Vim-like keys already implemented: j/k, h/l, f/b, d/u
• Navigation system is mature
4. Clipboard Integration:
• cmds = append(cmds, app.SetClipboard(lastTextPart.Text))
• app.SetClipboard() function exists
• Toast notification system available Reacted by Bremennaya, Yavorski, Danny Kok, Dmitry Gordienko, kajdo, cureforpain, Thomas G Henry, afkdev8, silentjay, gw0 and 71 more Activitygithub-actions commented on Sep 24, 2025 This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case. rekram1-node commented on Sep 24, 2025 yeah copying could be better, tui is being rewritten currently so features like this can best be addressed after the fact.
Ultimately all ux goes through @adamdotdevin Reacted by Thuan Pham, Juan David Merchan Torres, Nikita Kosachev, Aaron Myatt, Jimmy Loi, Flavio Garcia, Dmytro Pletenskyi and CristinoCg jonahbenton commented on Nov 19, 2025 Voting +1. Would also like selection by mouse and keyboard navigation. itse4elhaam commented on Dec 10, 2025 +1
Incompatible with tmux Copy Mode: OpenCode runs as a TUI application but doesn't integrate with tmux's copy
mode
This is one of the painpoints. Reacted by Chaskin Saroff, BlackRedGold, Iblea, Leon, Aaron Myatt, Benjamin, Yuki Ito, Jimmy Loi, Thuan Pham, Alex Heron and 8 more jkirkpatrick commented on Jan 25, 2026 +1
The "Copied to Clipboard" notification is a lie - not an error or omission.
It should be removed (and gated behind a feature flag) until tested and confirmed working. Reacted by Krzysztof Witczak and Dmytro Pletenskyi fadedlamp42 commented on Feb 6, 2026 A decent workaround, for now, is to:
- Use
^x x to "Export session transcript"
- Hold
^w to clear out the default filename and replace with /tmp/s[croll] (or whatever you prefer)
- Upon submitting, a child
$EDITOR /tmp/s opens (nvim for me) which provides access to the full conversation. A simple G and you can pretend you're in tmux scroll mode
EDIT: These make things not as bad, too
"messages_page_up": "pageup,ctrl+alt+b",
"messages_page_down": "pagedown,ctrl+alt+f",
"messages_line_up": "ctrl+alt+y",
"messages_line_down": "ctrl+alt+e",
"messages_half_page_up": "ctrl+alt+u",
"messages_half_page_down": "ctrl+alt+d",
"messages_first": "ctrl+g,home",
"messages_last": "ctrl+alt+g,end",
Reacted by Lu Fengqi, Juan David Merchan Torres, Tim Mastny and Robin Gagnon piraz commented on Mar 2, 2026 What about a float window with raw script for keyboard users, or raw/partial raw to editor? That will go to neovim btw and inside there is fair game. leohenon commented on Mar 20, 2026 I maintain ocv, an opencode fork with vim keybindings. It already supports visual mode with yank/put in the input. Full copy mode for the output buffer in the tui is coming soon.
brew install leohenon/tap/ocv
Reacted by Peter Gomez, silentjay, Thuan Pham, Yavorski, Eric Bartels and foxytanuki silentjay commented on Mar 25, 2026
I maintain ocv, an opencode fork with vim keybindings. It already supports visual mode with yank/put in the input. Full copy mode for the output buffer in the tui is coming soon.
Superb work! I need to look into running this on sidekick.nvim leohenon commented on Mar 26, 2026 @silentjay Im currently working on integrating my fork with this plugin opencode.nvim by nickjvandyke for a sidekick type integration but with vim mode in the opencode tui. leohenon commented on Mar 26, 2026 On a side note, copy mode is now fully implemented in the latest release of ocv.

silentjay commented on Mar 26, 2026
@silentjay Im currently working on integrating my fork with this plugin opencode.nvim by nickjvandyke for a sidekick type integration but with vim mode in the opencode tui.
That's interesting as I was planning on giving opencode.nvim a whirl at some point as well, although at this point I don't think I could live without the copilot NES functionality of sidekick.nvim! leohenon commented on Mar 27, 2026
That's interesting as I was planning on giving opencode.nvim a whirl at some point as well, although at this point I don't think I could live without the copilot NES functionality of sidekick.nvim!
Interesting, I haven’t used sidekick's NES much, just copilot tabbing. I might give it a shot and look into running ocv with sidekick.nvim is possible. egoarka commented on Apr 10, 2026 any progress? does not seem to work. tmux support? egoarka commented on Apr 10, 2026 just used mappings with xremap ( c-d / c-u ). and copy mode from alacritty. AnatolyHohuda commented on Apr 14, 2026 also wondering if Tmux copy mode support will be improved.
I'm mostly concerned about the text input at the bottom. sometimes questions/decisions tool is triggered by model and it takes up to 30% of the height of the terminal.
when that happens in the Claude Code I'm still able to scroll up with Tmux copy mode to take a look at things and then come back to the input. but in opencode, it's searching needle in the half of the screen height hay stack.
 Reacted by Dmytro Pletenskyi, r-3141592-pi and Andrew Scott github-actions commented on Jun 14, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one. Reacted by Eric Bartels, Rasmus Krogh Udengaard, Yaroslav Koisa, Daemon, Bytes, JustoRago, szelinskip, Andrew Scott, Jamie Kuppens, Matt and 10 more
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|