clipboard_paste: Require non-empty clipboard contents

Fixes #3637.
This commit is contained in:
Fabian Homborg 2016-12-10 21:26:51 +01:00
parent 05a640b027
commit 90f7d4b081

View file

@ -5,7 +5,9 @@ function fish_clipboard_paste
# Only run `commandline` if `xsel` succeeded. # Only run `commandline` if `xsel` succeeded.
# That way any xsel error is printed (to show e.g. a non-functioning X connection), # 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. # but we don't print the redundant (and overly verbose for this) commandline error.
# Also require non-empty contents to not clear the buffer.
if set -l data (xsel --clipboard) if set -l data (xsel --clipboard)
and test -n "$data"
commandline -i -- $data commandline -i -- $data
end end
end end