mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 13:08:49 +00:00
parent
f3f2d2d191
commit
2fd15e7c6c
2 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,8 @@ function fish_clipboard_copy
|
|||
if type -q pbcopy
|
||||
commandline | pbcopy
|
||||
else if type -q xsel
|
||||
commandline | xsel --clipboard
|
||||
# Silence error so no error message shows up
|
||||
# if e.g. X isn't running.
|
||||
commandline | xsel --clipboard 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,10 +4,9 @@ function fish_clipboard_paste
|
|||
set data (pbpaste)
|
||||
else if type -q xsel
|
||||
# Return if `xsel` failed.
|
||||
# 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.
|
||||
# That way we don't print the redundant (and overly verbose for this) commandline error.
|
||||
# Also require non-empty contents to not clear the buffer.
|
||||
if not set data (xsel --clipboard)
|
||||
if not set data (xsel --clipboard 2>/dev/null)
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue