fish-shell/share/functions/fish_clipboard_paste.fish
Fabian Homborg 422ff0f173 Don't paste if xsel fails
This silences a rather verbose error.
2016-12-02 01:29:58 +01:00

12 lines
454 B
Fish

function fish_clipboard_paste
if type -q pbpaste
commandline -i -- (pbpaste)
else if type -q xsel
# 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