Redirect stderr of xclip to /dev/null

xclip will display an error when pasting if the clipboard contains
something that isn't text:
  Error: target STRING not available

Swallow this error.
This commit is contained in:
Emily Grace Seville 2021-12-13 03:41:10 +10:00 committed by David Adam
parent 1d1bee3ba2
commit 077f1f2576

View file

@ -7,7 +7,7 @@ function fish_clipboard_paste
else if set -q DISPLAY; and type -q xsel
set data (xsel --clipboard)
else if set -q DISPLAY; and type -q xclip
set data (xclip -selection clipboard -o)
set data (xclip -selection clipboard -o 2>/dev/null)
else if type -q powershell.exe
set data (powershell.exe Get-Clipboard | string trim -r -c \r)
end