diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-07-12 18:56:09 +0200 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-07-12 18:56:09 +0200 |
commit | ef8e63a7fd30e04079e54ea76043c1db76e24ddf (patch) | |
tree | caf3f98752fdd49d8af19a16a17068a2dacaa0a9 /lib | |
parent | 39573125e4971b34e26f4cb3aaa210a74ea6ca34 (diff) | |
download | zsh-ef8e63a7fd30e04079e54ea76043c1db76e24ddf.tar.gz zsh-ef8e63a7fd30e04079e54ea76043c1db76e24ddf.tar.bz2 zsh-ef8e63a7fd30e04079e54ea76043c1db76e24ddf.zip |
fix(lib): prefer `xsel` over `xclip` in clipboard.zsh
See #10925
Diffstat (limited to 'lib')
-rw-r--r-- | lib/clipboard.zsh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index aab21a28a..ad83fc4b2 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -10,8 +10,8 @@ # - pbcopy, pbpaste (macOS) # - cygwin (Windows running Cygwin) # - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) -# - xclip (if $DISPLAY is set) # - xsel (if $DISPLAY is set) +# - xclip (if $DISPLAY is set) # - lemonade (for SSH) https://github.com/pocke/lemonade # - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ # - win32yank (Windows) @@ -60,12 +60,12 @@ function detect-clipboard() { elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; } function clippaste() { wl-paste; } - elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | xclip -selection clipboard -in &>/dev/null &|; } - function clippaste() { xclip -out -selection clipboard; } elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then function clipcopy() { cat "${1:-/dev/stdin}" | xsel --clipboard --input; } function clippaste() { xsel --clipboard --output; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then + function clipcopy() { cat "${1:-/dev/stdin}" | xclip -selection clipboard -in &>/dev/null &|; } + function clippaste() { xclip -out -selection clipboard; } elif (( ${+commands[lemonade]} )); then function clipcopy() { cat "${1:-/dev/stdin}" | lemonade copy; } function clippaste() { lemonade paste; } |