From a8e9f560e4fb3b6e35860973df89609d0982f95f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 14 May 2020 21:07:37 +0200 Subject: [PATCH] fish_clipboard_copy: also copy newlines from mult-line commands --- share/functions/fish_clipboard_copy.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/fish_clipboard_copy.fish b/share/functions/fish_clipboard_copy.fish index 6bb60a473..b6155e85f 100644 --- a/share/functions/fish_clipboard_copy.fish +++ b/share/functions/fish_clipboard_copy.fish @@ -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