fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
8bf8b10f6
master
1function fish_clipboard_paste 2set -l data 3if type -q pbpaste 4set data( pbpaste 2> /dev/null| string collect -N) 5else if set -q WAYLAND_DISPLAY;and type -q wl-paste 6set data( wl-paste -n2> /dev/null| string collect -N) 7else if set -q DISPLAY;and type -q xsel 8set data( xsel --clipboard| string collect -N) 9else if set -q DISPLAY;and type -q xclip 10set data( xclip -selection clipboard -o2> /dev/null| string collect -N) 11else if type -q powershell.exe 12set data( powershell.exe Get-Clipboard| string trim -r -c\r | string collect -N) 13end 14 15# Issue 6254: Handle zero-length clipboard content 16if not string length -q --" $data " 17return 1 18end 19 20if not isatty stdout 21# If we're redirected, just write the data *as-is*. 22printf %s$data 23return 24end 25 26__fish_paste $data 27end