mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 04:13:08 +00:00
Don't paste if xsel fails
This silences a rather verbose error.
This commit is contained in:
parent
e2ed561264
commit
422ff0f173
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue