Skip to content

fix(tmux): use PowerShell for WSL clipboard to support UTF-8#75

Merged
bfly123 merged 1 commit intobfly123:mainfrom
HamsteRider-m:fix/wsl-clipboard-utf8
Feb 4, 2026
Merged

fix(tmux): use PowerShell for WSL clipboard to support UTF-8#75
bfly123 merged 1 commit intobfly123:mainfrom
HamsteRider-m:fix/wsl-clipboard-utf8

Conversation

@HamsteRider-m
Copy link

Problem

In WSL environment, tmux copy mode produces garbled output when copying Chinese characters, emojis, or other non-ASCII text.

Root cause: clip.exe doesn't support UTF-8 encoding.

Solution

  • Add WSL-specific clipboard bindings using PowerShell's Set-Clipboard/Get-Clipboard
  • Detect WSL environment via $WSL_DISTRO_NAME to avoid affecting other platforms (macOS, native Windows, Linux)
  • PowerShell natively supports Unicode, fixing the encoding issue

Changes

  • config/tmux-ccb.conf: Added WSL clipboard copy/paste bindings

Testing

Tested on WSL2 (Ubuntu) - Chinese characters and emojis now copy correctly to Windows clipboard.

Problem:
- clip.exe doesn't support UTF-8 encoding
- Copying Chinese/emoji in WSL results in garbled output

Solution:
- Replace clip.exe with PowerShell Set-Clipboard
- Detect WSL via $WSL_DISTRO_NAME to avoid affecting other platforms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@HamsteRider-m HamsteRider-m force-pushed the fix/wsl-clipboard-utf8 branch from cccc898 to d1fdbda Compare February 4, 2026 02:44
@bfly123 bfly123 merged commit d371028 into bfly123:main Feb 4, 2026
10 of 13 checks 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.

2 participants