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