Skip to content

feat(tui): add clipboard copy support to observation screens #141

@Snakeblack

Description

@Snakeblack

Summary

The TUI currently lets users navigate and view observations, but there's no way to copy their content to the clipboard. Users who find a useful memory must manually select text or leave the TUI to retrieve it via CLI.

Proposal

Add a c keybinding that copies the content of the selected/displayed observation to the system clipboard using OSC 52 terminal escape sequences (via go-osc52/v2, already a transitive dependency).

Screens affected

  • Recent Observations — copy selected item's content
  • Observation Detail — copy the full observation content
  • Search Results — copy selected result's content
  • Session Detail — copy selected observation's content

Why OSC 52

  • Works over SSH sessions (critical for CLI tool users)
  • No system dependencies (no xclip/xsel/pbcopy needed)
  • Already available as transitive dep from the Charm ecosystem
  • Supported by 95%+ of modern terminals (Windows Terminal, VS Code, iTerm2, Kitty, WezTerm)

UX

  • Press c → content is copied → "✓ Copied!" feedback appears for 2 seconds
  • If the terminal doesn't support OSC 52 → "✗ Copy failed" feedback
  • Help text on each screen updated to show the new keybinding

Acceptance Criteria

  • c copies the observation content on all 4 screens listed above
  • Visual feedback is shown for 2 seconds after copy
  • Graceful failure on unsupported terminals
  • No new dependencies added (uses existing transitive dep)
  • All existing TUI tests continue passing

Metadata

Metadata

Assignees

No one assigned

    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