fish_clipboard_copy: also copy newlines from mult-line commands

This commit is contained in:
Johannes Altmanninger
2020-05-14 21:07:37 +02:00
parent 3ee4c139b3
commit a8e9f560e4

View File

@@ -1,7 +1,7 @@
function fish_clipboard_copy
# Copy the current selection, or the entire commandline if that is empty.
set -l cmdline (commandline --current-selection)
test -n "$cmdline"; or set cmdline (commandline)
set -l cmdline (commandline --current-selection | string collect)
test -n "$cmdline"; or set cmdline (commandline | string collect)
if type -q pbcopy
printf '%s' $cmdline | pbcopy
else if set -q WAYLAND_DISPLAY; and type -q wl-copy