mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 17:07:44 +00:00
add xclip support for clipboard copy and paste functions
This commit is contained in:
parent
56198818b0
commit
ebc5e18956
2 changed files with 6 additions and 0 deletions
|
@ -5,5 +5,7 @@ function fish_clipboard_copy
|
|||
# Silence error so no error message shows up
|
||||
# if e.g. X isn't running.
|
||||
commandline | xsel --clipboard 2>/dev/null
|
||||
else if type -q xclip
|
||||
commandline | xclip -selection clipboard 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,6 +9,10 @@ function fish_clipboard_paste
|
|||
if not set data (xsel --clipboard 2>/dev/null)
|
||||
return 1
|
||||
end
|
||||
else if type -q xclip
|
||||
if not set data (xclip -selection clipboard -o 2>/dev/null)
|
||||
return 1
|
||||
end
|
||||
end
|
||||
# Also split on \r to turn it into a newline,
|
||||
# otherwise the output looks really confusing.
|
||||
|
|
Loading…
Reference in a new issue