Skip to content

Add Wayland clipboard support for TUI#446

Merged
cjimti merged 1 commit intomasterfrom
feature/wayland-clipboard-support
Mar 29, 2026
Merged

Add Wayland clipboard support for TUI#446
cjimti merged 1 commit intomasterfrom
feature/wayland-clipboard-support

Conversation

@cjimti
Copy link
Copy Markdown
Member

@cjimti cjimti commented Mar 29, 2026

Summary

Adds wl-copy (from wl-clipboard) as a supported clipboard provider in the TUI detail view, enabling copy-to-clipboard on Wayland-based Linux desktops.

  • Detects the active display server via WAYLAND_DISPLAY environment variable to prefer the appropriate clipboard tool
  • When running under Wayland: tries wl-copyxclipxsel (XWayland fallback)
  • When running under X11: tries xclipxselwl-copy (reverse fallback)
  • macOS (pbcopy) behavior is unchanged

Motivation

Linux distributions are increasingly adopting Wayland as the default display server (GNOME, KDE Plasma 6, Sway, Hyprland, etc.). The existing X11-only clipboard tools (xclip, xsel) do not work in pure Wayland sessions, making the TUI's connection string copy feature non-functional for a growing number of users.

Test plan

  • Verify clipboard copy still works on macOS (pbcopy)
  • Verify clipboard copy works on Linux/X11 with xclip or xsel installed
  • Verify clipboard copy works on Linux/Wayland with wl-clipboard installed
  • Verify fallback ordering: Wayland session with only xclip installed still works (XWayland)
  • Verify graceful failure when no clipboard tool is available (returns false, no crash)

Closes #445

Refactor copyToClipboard to use a table-driven candidate list with
environment-aware ordering. When WAYLAND_DISPLAY is set, wl-copy is
preferred over X11 tools; otherwise X11 tools are tried first.

Closes #445
@cjimti cjimti self-assigned this Mar 29, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 55.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.13%. Comparing base (7737f0b) to head (9076bf9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/fwdtui/components/detail.go 55.00% 7 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #446      +/-   ##
==========================================
- Coverage   81.15%   81.13%   -0.03%     
==========================================
  Files          71       71              
  Lines       12765    12779      +14     
==========================================
+ Hits        10360    10368       +8     
- Misses       2001     2006       +5     
- Partials      404      405       +1     
Files with missing lines Coverage Δ
pkg/fwdtui/components/detail.go 75.54% <55.00%> (-0.10%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cjimti cjimti merged commit 4201e04 into master Mar 29, 2026
11 checks passed
@cjimti cjimti deleted the feature/wayland-clipboard-support branch March 29, 2026 05:24
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.

Support copy connection strings on wayland

1 participant