Skip to content

fix(os): support OSC 52 clipboard sequences and Wayland wl-copy fallback - #45

Open
felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:fix/clipboard-wayland-osc52
Open

felipecm-br wants to merge 1 commit into
Blankeos:mainfrom
felipecm-br:fix/clipboard-wayland-osc52

Conversation

@felipecm-br

Copy link
Copy Markdown
Contributor

Summary

Enhances clipboard copy functionality across modern terminal environments and Linux display servers:

  • OSC 52 Support: Emits ANSI OSC 52 escape sequences (\x1b]52;c;<base64>\x07, with tmux passthrough wrapping when TMUX is set). This enables clipboard copying over SSH, remote tmux sessions, and modern terminals (Alacritty, Kitty, WezTerm, iTerm2, foot, ghostty, etc.) without requiring local clipboard binaries.
  • Wayland Support (wl-copy): On Linux, tries wl-copy first before falling back to xclip and xsel.
  • Non-blocking Spawn: Dispatches external clipboard utility calls in a background thread so terminal responsiveness is never blocked by clipboard processes.
  • Stdin Flush & Drop: Explicitly drops child stdin after writing in CmdBuilder::run_with_stdin, sending an immediate EOF so clipboard processes do not hang waiting for standard input.
  • Unit Tests: Added test suite for base64 encoding in src/os/platform.rs.

Verification

  • cargo fmt checked.
  • cargo test --bin lazygitrs (372 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant