fix(tmux): stop clip.exe mangling non-ASCII in the WSL clipboard #103

Merged
lyrathorpe merged 1 commits from fix/tmux-clipboard-utf8 into main 2026-08-24 13:36:16 +01:00
1 Commits
Author SHA1 Message Date
Emma Thorpe d9db12c4a5 fix(tmux): stop clip.exe mangling non-ASCII in the WSL clipboard
CI / flake (push) Skipped
CI / flake (pull_request) Successful in 7m8s
tmux-yank autodetects WSL and pipes the selection to clip.exe, which
decodes its stdin as the console OEM codepage rather than UTF-8. Copying
an em dash out of a pane put "ΓÇö" on the Windows clipboard; the same
applies to every non-ASCII character.

Override the copy command to route through tmux's own buffer. With
set-clipboard on, that emits OSC 52 and the terminal receives UTF-8
directly, with no Windows-side helper in the path. Windows Terminal
honours OSC 52; verified against the running client.

Guarded on /proc/version so only WSL is affected. iTerm2 does not accept
OSC 52 by default, so the Darwin hosts keep pbcopy.

Set in the plugin's extraConfig rather than the shared block because
yank.tmux bakes the copy command into its key bindings at load time, and
home-manager emits plugin extraConfig before the run-shell.
2026-08-24 13:26:21 +01:00