mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
Revert "Set fish_clipboard_paste handler once on startup"
This reverts commit f620ddf03b.
Setting the paste handler isn't performance-sensitive.
On the other hand setting it this way makes things less transparent,
less flexible (if e.g. a paste handler is installed while the shell is running),
and causes #6286.
Fixes #6286.
[ci skip]
This commit is contained in:
@@ -1,24 +1,14 @@
|
|||||||
# Search for and set clipboard handler only once at startup
|
|
||||||
if type -q pbpaste
|
|
||||||
function __fish_clipboard_paste
|
|
||||||
pbpaste 2>/dev/null
|
|
||||||
end
|
|
||||||
else if set -q WAYLAND_DISPLAY; and type -q wl-paste
|
|
||||||
function __fish_clipboard_paste
|
|
||||||
wl-paste 2>/dev/null
|
|
||||||
end
|
|
||||||
else if type -q xsel
|
|
||||||
function __fish_clipboard_paste
|
|
||||||
xsel --clipboard 2>/dev/null
|
|
||||||
end
|
|
||||||
else if type -q xclip
|
|
||||||
function __fish_clipboard_paste
|
|
||||||
xclip -selection clipboard -o 2>/dev/null
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function fish_clipboard_paste
|
function fish_clipboard_paste
|
||||||
set -l data (__fish_clipboard_paste)
|
set -l data
|
||||||
|
if type -q pbpaste
|
||||||
|
set data (pbpaste 2>/dev/null)
|
||||||
|
else if set -q WAYLAND_DISPLAY; and type -q wl-paste
|
||||||
|
set data (wl-paste 2>/dev/null)
|
||||||
|
else if type -q xsel
|
||||||
|
set data (xsel --clipboard 2>/dev/null)
|
||||||
|
else if type -q xclip
|
||||||
|
set data (xclip -selection clipboard -o 2>/dev/null)
|
||||||
|
end
|
||||||
|
|
||||||
# Issue 6254: Handle zero-length clipboard content
|
# Issue 6254: Handle zero-length clipboard content
|
||||||
if not string match -qr . -- "$data"
|
if not string match -qr . -- "$data"
|
||||||
|
|||||||
Reference in New Issue
Block a user