fa770f9678477febe0ed99566d9f3331f3714eca

Author
Jordan Galby <gravemind2a@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(clipboard): remove clippaste additional newline on wayland (#12140)

So clippaste behaves the same as on X11 (xsel, xclip).

Diff

 1diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
 2index 4b37abc9bab4e9993fd0655bd5fd357cc2f23ab3..5d149f05629813ef426d389235d500c5a77e57cf 100644
 3--- a/lib/clipboard.zsh
 4+++ b/lib/clipboard.zsh
 5@@ -62,7 +62,7 @@ function detect-clipboard() {
 6     function clippaste() { powershell.exe -noprofile -command Get-Clipboard; }
 7   elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then
 8     function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; }
 9-    function clippaste() { wl-paste; }
10+    function clippaste() { wl-paste --no-newline; }
11   elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then
12     function clipcopy() { cat "${1:-/dev/stdin}" | xsel --clipboard --input; }
13     function clippaste() { xsel --clipboard --output; }