Add support for copy and paste in WSL
- clip.exe is used to copy to the Windows clipboard - There's no binary for pasting from the Windows clipboard so `Get-Clipboard` from powershell is used as a workaround. The superflous carriage return is stripped from the output.
This commit is contained in:
parent
69ab68d856
commit
ea1dffd53d
@ -12,5 +12,7 @@ function fish_clipboard_copy
|
||||
printf '%s' $cmdline | xsel --clipboard 2>/dev/null
|
||||
else if type -q xclip
|
||||
printf '%s' $cmdline | xclip -selection clipboard 2>/dev/null
|
||||
else if type -q clip.exe
|
||||
printf '%s' $cmdline | clip.exe
|
||||
end
|
||||
end
|
||||
|
@ -8,6 +8,8 @@ function fish_clipboard_paste
|
||||
set data (xsel --clipboard 2>/dev/null)
|
||||
else if type -q xclip
|
||||
set data (xclip -selection clipboard -o 2>/dev/null)
|
||||
else if type -q powershell.exe
|
||||
set data (powershell.exe Get-Clipboard | string trim -r -c \r)
|
||||
end
|
||||
|
||||
# Issue 6254: Handle zero-length clipboard content
|
||||
|
Loading…
x
Reference in New Issue
Block a user