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
+16 -1
View File
@@ -287,7 +287,22 @@ in
plugins = with pkgs.tmuxPlugins; [ plugins = with pkgs.tmuxPlugins; [
sensible sensible
vim-tmux-navigator # Ctrl-h/j/k/l across vim splits and tmux panes vim-tmux-navigator # Ctrl-h/j/k/l across vim splits and tmux panes
yank {
# On WSL, tmux-yank pipes the selection to clip.exe, which decodes its
# stdin as the OEM codepage instead of UTF-8 -- an em dash reaches the
# Windows clipboard as three characters. Route through tmux's own
# buffer instead: with set-clipboard on, tmux emits OSC 52 and the
# terminal takes the text as UTF-8. Windows Terminal honours OSC 52;
# iTerm2 does not by default, hence the runtime guard rather than
# overriding pbcopy/xsel on every host. yank.tmux bakes the command
# into its key bindings when it loads, so this must be set first, which
# is what plugin extraConfig gives us.
plugin = yank;
extraConfig = ''
if-shell 'grep -qi microsoft /proc/version 2>/dev/null' \
"set -g @override_copy_command 'tmux load-buffer -w -'"
'';
}
extrakto # prefix+Tab: fzf-grab paths/URLs/text from the pane into the prompt extrakto # prefix+Tab: fzf-grab paths/URLs/text from the pane into the prompt
{ {
# Catppuccin Mocha statusline (v2 API: flavour + window options must be # Catppuccin Mocha statusline (v2 API: flavour + window options must be