From 57739cbcb64fb5d166f35b877ffb10b8120256b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 27 Feb 2020 23:24:23 +0100 Subject: [PATCH] lib: add support for clip.exe clipboard copy in WSL --- lib/clipboard.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 6102f3324..92959bc03 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -78,6 +78,9 @@ function detect-clipboard() { elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then function clipcopy() { tmux load-buffer "${1:--}"; } function clippaste() { tmux save-buffer -; } + elif [[ $(uname -r) = *icrosoft* ]]; then + function clipcopy() { clip.exe < "${1:-/dev/stdin}"; } + function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } else function _retry_clipboard_detection_or_fail() { local clipcmd="${1}"; shift