mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
fish_clipboard_copy: also copy newlines from mult-line commands
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user