diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-06-19 12:54:11 +0200 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-07-12 18:52:21 +0200 |
commit | 4506210c38774bc5da1a0495c2a911776cf6f2cb (patch) | |
tree | 40fcd90aa31fea4b39f33b62ecf7f9ce79b15df1 /lib | |
parent | 5336e59db1b76b9b5439099cbc5a311796d32ba9 (diff) | |
download | zsh-4506210c38774bc5da1a0495c2a911776cf6f2cb.tar.gz zsh-4506210c38774bc5da1a0495c2a911776cf6f2cb.tar.bz2 zsh-4506210c38774bc5da1a0495c2a911776cf6f2cb.zip |
fix(lib): don't attach to tty in `wl-copy` and `xclip` (#10953)
Fixes #10925
Diffstat (limited to 'lib')
-rw-r--r-- | lib/clipboard.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 4e3ba0a45..272b41598 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -58,10 +58,10 @@ function detect-clipboard() { function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } function clippaste() { cat /dev/clipboard; } elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then - function clipcopy() { wl-copy < "${1:-/dev/stdin}"; } + function clipcopy() { wl-copy < "${1:-/dev/stdin}" &>/dev/null &|; } function clippaste() { wl-paste; } elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then - function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } + function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}" &>/dev/null &|; } function clippaste() { xclip -out -selection clipboard; } elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } |