diff --git a/share/functions/fish_clipboard_paste.fish b/share/functions/fish_clipboard_paste.fish index 105ca1226..f9ab3dabe 100644 --- a/share/functions/fish_clipboard_paste.fish +++ b/share/functions/fish_clipboard_paste.fish @@ -26,7 +26,11 @@ function fish_clipboard_paste # # This eases pasting non-code (e.g. markdown or git commitishes). if __fish_commandline_is_singlequoted - set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data) + if status test-feature string-replace-fewer-backslashes + set data (string replace -ra "(['\\\])" '\\\\$1' -- $data) + else + set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data) + end end if not string length -q -- (commandline -c) # If we're at the beginning of the first line, trim whitespace from the start,