Skip to content

fix(fish): copy through OSC 52 from Herdr terminals on hosts with a desktop - #86

Merged
barbatdev merged 1 commit into
mainfrom
fix/herdr-remote-clipboard
Oct 30, 2026
Merged

barbatdev merged 1 commit into
mainfrom
fix/herdr-remote-clipboard

Conversation

@barbatdev

Copy link
Copy Markdown
Owner

Summary

Selecting text in gentle-shell (Pi) inside a Herdr Desktop window showed "copied" but nothing reached the Mac clipboard, only for terminals on agent-gentle.

Cause: agent-gentle has its own Wayland desktop. herdr-core hands every terminal it starts this host's DISPLAY / WAYLAND_DISPLAY, and those terminals have no SSH_CONNECTION (herdr-core starts them, not an SSH login). Pi's copyToClipboard then treats the session as local, copies with wl-copy into agent-gentle's own clipboard and never emits OSC 52, which is what Herdr forwards to the viewing machine. agent-dev has no desktop, so Pi falls back to OSC 52 there and copying works.

Fix: fish/conf.d/20-herdr-clipboard.fish drops DISPLAY and WAYLAND_DISPLAY only for shells started by herdr-core (HC_TERMINAL_ID set) that are not real SSH sessions. Other shells on the host keep the desktop. On hosts without a desktop (this Mac, agent-dev) it changes nothing. Registered in nix/home.nix next to 10-core.fish.

An earlier systemd drop-in (UnsetEnvironment= on the hc-* units) did not help: herdr-core re-adds the variables when it spawns each terminal.

Verification

  • fish -n passes. Local cases: Herdr shell drops both variables; plain shell keeps DISPLAY; Herdr shell inside a real SSH session keeps its forwarded DISPLAY.
  • Installed on agent-gentle (~/.config/fish/conf.d/, 0644, same SHA-256 as the repo); the same cases pass there.
  • Confirmed by the user: mouse selection in gentle-shell on agent-gentle now reaches the Mac clipboard.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A9D7ph123Jn8iB1eGbr8Nz

@barbatdev
barbatdev merged commit 5ba0310 into main Oct 30, 2026
1 check passed
@barbatdev
barbatdev deleted the fix/herdr-remote-clipboard branch October 31, 2026 16:00
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