GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Copy Mode for OpenCode · Issue #2755 · anomalyco/opencode

feat: Copy Mode for OpenCode #2755

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
feat: Copy Mode for OpenCode#2755
Copy link
Assignees
adamdotdevin

Description

@thuanpham582002
thuanpham582002
opened on Sep 24, 2025
Issue body actions

Summary

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

  1. No Keyboard-based Text Selection: Users cannot select text using keyboard only
  2. Limited Copy Functionality: Only entire message copying is available (ctrl+x y)
  3. Incompatible with tmux Copy Mode: OpenCode runs as a TUI application but doesn't integrate with tmux's copy
    mode
  4. Poor UX for Code Review: Cannot selectively copy code snippets, error messages, or specific parts of
    responses
  5. 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 (✅)

  1. 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

Activity

  1. github-actions commented on Sep 24, 2025

    @github-actions
    github-actionsBot
    on Sep 24, 2025 – with GitHub Actions
    Contributor
    More actions

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

    • No way to select or copy text, either in the input field or from the output messages #2114: Directly addresses the core problem - no way to select or copy text from output messages
    • Add a /copy command to copy latest message (or allow scrolling while selecting text) #2118: Requests a /copy command and better text selection with scrolling capabilities
    • Mouse text selection has unexpected behavior in terminal #1210: Addresses mouse text selection issues and specifically mentions wanting vim/tmux-like behavior
    • [Question] how to scroll by keyboard? #862: Requested keyboard shortcuts for scrolling (Ctrl+d, Ctrl+u) and mentions tmux usage
    • Standard keyboard cursor navigation (Home/End key, ctrl+left/right key) #2649: Requests improved keyboard navigation (Home/End, ctrl+left/right keys)

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node
    assigned
    adamdotdevin
    on Sep 24, 2025
  3. rekram1-node commented on Sep 24, 2025

    @rekram1-node
    rekram1-node
    on Sep 24, 2025
    Member
    More actions

    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
  4. jonahbenton commented on Nov 19, 2025

    @jonahbenton
    jonahbenton
    on Nov 19, 2025
    More actions

    Voting +1. Would also like selection by mouse and keyboard navigation.

  5. itse4elhaam commented on Dec 10, 2025

    @itse4elhaam
    itse4elhaam
    on Dec 10, 2025
    More actions

    +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
  6. jkirkpatrick commented on Jan 25, 2026

    @jkirkpatrick
    jkirkpatrick
    on Jan 25, 2026
    More actions

    +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
  7. fadedlamp42 commented on Feb 6, 2026

    @fadedlamp42
    fadedlamp42
    on Feb 6, 2026
    More actions

    A decent workaround, for now, is to:

    1. Use ^x x to "Export session transcript"
    2. Hold ^w to clear out the default filename and replace with /tmp/s[croll] (or whatever you prefer)
    3. 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
  8. piraz commented on Mar 2, 2026

    @piraz
    piraz
    on Mar 2, 2026
    More actions

    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.

  9. praxstack
    added a commit that references this issue on Mar 3, 2026

    docs: assessment of next 4 upstream issues (anomalyco#2755, anomalyco…

    50fa67d
  10. leohenon commented on Mar 20, 2026

    @leohenon
    leohenon
    on Mar 20, 2026
    More actions

    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
  11. silentjay commented on Mar 25, 2026

    @silentjay
    silentjay
    on Mar 25, 2026
    More actions

    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

  12. leohenon commented on Mar 26, 2026

    @leohenon
    leohenon
    on Mar 26, 2026
    More actions

    @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.

  13. leohenon commented on Mar 26, 2026

    @leohenon
    leohenon
    on Mar 26, 2026
    More actions

    On a side note, copy mode is now fully implemented in the latest release of ocv.

    Image

  14. silentjay commented on Mar 26, 2026

    @silentjay
    silentjay
    on Mar 26, 2026
    More actions

    @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!

  15. leohenon commented on Mar 27, 2026

    @leohenon
    leohenon
    on Mar 27, 2026
    More actions

    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.

  16. egoarka commented on Apr 10, 2026

    @egoarka
    egoarka
    on Apr 10, 2026
    More actions

    any progress? does not seem to work. tmux support?

  17. egoarka commented on Apr 10, 2026

    @egoarka
    egoarka
    on Apr 10, 2026
    More actions

    just used mappings with xremap ( c-d / c-u ). and copy mode from alacritty.

  18. AnatolyHohuda commented on Apr 14, 2026

    @AnatolyHohuda
    AnatolyHohuda
    on Apr 14, 2026
    More actions

    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.

    Image
    Reacted by Dmytro Pletenskyi, r-3141592-pi and Andrew Scott
  19. github-actions commented on Jun 14, 2026

    @github-actions
    github-actionsBot
    on Jun 14, 2026 – with GitHub Actions
    Contributor
    More actions

    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
  20. github-actions
    closed this as not plannedon Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adamdotdevin
    adamdotdevin

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.