Don't paste if xsel fails

This silences a rather verbose error.
This commit is contained in:
Fabian Homborg 2016-11-28 10:09:58 +01:00
parent e2ed561264
commit 422ff0f173

View file

@ -2,6 +2,11 @@ function fish_clipboard_paste
if type -q pbpaste
commandline -i -- (pbpaste)
else if type -q xsel
commandline -i -- (xsel --clipboard)
# Only run `commandline` if `xsel` succeeded.
# That way any xsel error is printed (to show e.g. a non-functioning X connection),
# but we don't print the redundant (and overly verbose for this) commandline error.
if set -l data (xsel --clipboard)
commandline -i -- $data
end
end
end