1jehuang / 1jehuang/jcode

cmux copy selection does not sync to local clipboard

Open
#333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: medium triage: reproducible
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

Problem

Copy selection with auto-copy in Jcode does not work correctly when running through cmux/browser-backed terminals.

Observed behavior:

  • Drag/select text in the Jcode TUI.
  • Jcode reports that the selection was copied.
  • The browser/local clipboard is not updated, so paste does not contain the selected text.

Likely cause

The existing clipboard path uses host-side clipboard integrations such as wl-copy and arboard. In a remote or browser-backed terminal environment, these can succeed while only updating the remote host clipboard, not the user's local/browser clipboard.

Proposed fix

Emit an OSC 52 clipboard escape sequence whenever Jcode copies selected text, while preserving the existing host clipboard behavior. OSC 52 lets terminal frontends synchronize copied text to the user's local clipboard when supported.

PR

Proposed fix: https://github.com/1jehuang/jcode/pull/332

Validation in PR

  • cargo fmt
  • cargo test clipboard_tests::osc52_clipboard_sequence --lib
  • cargo test test_copy_selection_mouse_drag_auto_copies_and_exits_mode --lib

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with proposed PR #332 and the clipboard-related code it changes. Run the listed OSC 52 and mouse-drag clipboard tests; the issue is complete when those tests pass and the local clipboard synchronization behavior is covered without regressing existing host clipboard behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.