mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
add xclip support for clipboard copy and paste functions
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user