1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-22 04:11:58 +00:00

lib: add support for clip.exe clipboard copy in WSL

This commit is contained in:
Marc Cornellà 2020-02-27 23:24:23 +01:00
parent 65642dfcff
commit 57739cbcb6

View file

@ -78,6 +78,9 @@ function detect-clipboard() {
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; } function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; } 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 else
function _retry_clipboard_detection_or_fail() { function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift local clipcmd="${1}"; shift