Switch to win32yank.exe for clipboard in WSL2
Using `xclip` or `xsel` in WSL2 started causing Windows GUI applications to hang when pasting from the clipboard set by `xclip`/`xsel` waiting on input from a clipboard process which had already exited. When WSL is detected, use `win32yank.exe` instead. This is available via Chocolatey but is also shipped with the Neovim Windows installation. For more context, see https://github.com/microsoft/terminal/issues/11945
This commit is contained in:
parent
6629046ec2
commit
6beb81f972
12
tmux.conf
12
tmux.conf
@ -115,12 +115,14 @@ bind -n WheelDownPane \
|
||||
\"select-pane -t= ; \
|
||||
send-keys -M\" "
|
||||
|
||||
# Yank to the system clipboard in copy mode
|
||||
# Yank to the system clipboard in copy mode.
|
||||
# TODO: reattach-to-user-namespace not necessary with tmux > 2.6
|
||||
if -b '[ "`uname`" = "Darwin" ]' \
|
||||
'bind -T copy-mode-vi y send-keys -X copy-pipe \
|
||||
"reattach-to-user-namespace pbcopy"' \
|
||||
'bind -T copy-mode-vi y send -X copy-pipe \
|
||||
"xclip -i -sel p -f | xclip -i -sel c"'
|
||||
'bind -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"'
|
||||
# When not in WSL2 use xsel, when in WSL use win32yank.exe to avoid UI lockups.
|
||||
if -b '[ "$WSLENV" = "" ]' \
|
||||
'bind -T copy-mode-vi y send-keys -X copy-pipe "xsel -i --clipboard"' \
|
||||
'bind -T copy-mode-vi y send-keys -X copy-pipe "win32yank.exe -i -crlf"'
|
||||
|
||||
# Left status style
|
||||
if -b '[ "$WSL_DISTRO_NAME" != "" ]' \
|
||||
|
Loading…
x
Reference in New Issue
Block a user