Skip to content

[feat] support to select the assistant's output text with the mouse #292

Closed as duplicate

Description

@douglarek

I don't know about TUI and I'm not sure if mouse operations can be performed on terminal text.

Note: I am using version 0.1.117.

Activity

  1. changed the title [-][bug] Unable to select the assistant's output text with the mouse[/-] [+][feat] support to select the assistant's output text with the mouse[/+] on Jun 21, 2025
  2. monotykamary commented on Jun 21, 2025

    @monotykamary
    Contributor

    FWIW, block mode tmux copying still works. Otherwise, the effort for this shouldn't be too big.


    1. Add mouse drag selection handling in packages/tui/internal/tui/tui.go
    2. Track selection state (start/end positions) in the TUI model
    3. Modify message rendering to highlight selected text regions
    4. Add clipboard integration for copy functionality

    Low-Medium effort - the foundational work is already complete:

    • ✅ Mouse support already implemented
    • ✅ Text rendering system in place using glamour
    • ✅ Event handling architecture established with Bubbletea

    Approximately 150-300 lines of Go code:

    • Mouse selection logic: ~100 lines in tui.go
    • Selection state management: ~50 lines
    • Visual highlighting: ~50-100 lines (modify existing render functions)
    • Clipboard integration: ~50 lines
  3. cravenceiling commented on Jun 22, 2025

    @cravenceiling
    Contributor

    I think this is a duplicate of #212. You can select text by holding shift.

  4. monotykamary commented on Jun 22, 2025

    @monotykamary
    Contributor

    you definitely can select text that way, but you also copy everything else in the UI:

    Image

    in tmux, you can use block copy and have a special pipe to parse it; this would probably be the goal if possible with bubbletea:

    Image

    edit: actually this lazy pipe works with tmux

    bind-key -T copy-mode-vi Y send-keys -X copy-pipe "tmux show-buffer | claude -p 'Clean up this text by removing trailing whitespace, connecting lines appropriately, and making it readable as a single coherent block of text. Return only the cleaned text with no additional commentary: ' | pbcopy"
    

    if we're super lazy, we could just hijack the copy and clean up the text through a cheap LLM

  5. orlandokj commented on Jun 24, 2025

    @orlandokj

    I think it would be nice to have a copy option in the message, can be a command like /copy or maybe we can navigate the selected message through some keybind and then hit another keybind to copy it to clipboard.

  6. adamdotdevin commented on Jul 16, 2025

    @adamdotdevin
    Member

    taking the convo to #212

  7. added a commit that references this issue on Jan 16, 2026
    33aee23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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