Skip to content

馃悰 fix pass -c clipboard on Linux/X11, add tmux integration - #19

Merged
mandus merged 1 commit into
mainfrom
fix/19-linux-clipboard-x11
Jul 26, 2026
Merged

mandus merged 1 commit into
mainfrom
fix/19-linux-clipboard-x11

Conversation

@mandus

@mandus mandus commented Jul 26, 2026

Copy link
Copy Markdown
Owner

replaced windows-only clipboard support with support for linux, and with direct support for tmux when running inside tmux

pkg/filesystem.CopyToClipboard hard-coded the Windows-only `clip`
command, so `pass -c` failed unconditionally on every non-Windows
platform with "exec: \"clip\": executable file not found in $PATH",
despite the tool advertising cross-platform clipboard support.

- Replace the Windows-only implementation with github.com/atotto/clipboard
  (already an indirect dependency, now promoted to direct), which uses
  xclip/xsel on X11, wl-copy on Wayland, pbcopy on macOS, and clip.exe on
  Windows.
- When running inside tmux (TMUX env var set), also load the password into
  a dedicated tmux paste buffer via `tmux load-buffer -w -b pass -`, so
  `pass -c` still works over SSH sessions with no X11/Wayland display
  reachable by a system clipboard utility. The -w flag additionally
  forwards the buffer to the terminal's clipboard via OSC 52 when tmux's
  set-clipboard option and the terminal support it.
- Fail with a clear, actionable error when no clipboard utility and no
  tmux session are available, instead of a confusing exec error.
- Update fs_test.go clipboard availability checks and add tmux detection
  and tmux paste-buffer integration tests (self-skip outside tmux).
- Supersede AD-005 in the decision log with AD-012; update CHANGELOG,
  README, and add specs/008-linux-clipboard-fix/spec.md.

Verified manually end-to-end in this environment's real tmux session
(no X server): `pass -c` succeeds and the password is retrievable via
`tmux show-buffer -b pass`.
@mandus
mandus merged commit ffad3be into main Jul 26, 2026
1 check 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