mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 20:31:19 -03:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user