diff --git a/share/functions/abbr.fish b/share/functions/abbr.fish index fdb6d6ae9..393e8243e 100644 --- a/share/functions/abbr.fish +++ b/share/functions/abbr.fish @@ -100,7 +100,9 @@ function abbr --description "Manage abbreviations" case 'show' for i in $fish_user_abbreviations - echo abbr -a \'$i\' + # Disable newline splitting + set -lx IFS '' + echo abbr -a \'(__fish_abbr_escape $i)\' end return 0 @@ -114,6 +116,10 @@ function abbr --description "Manage abbreviations" end end +function __fish_abbr_escape + echo $argv | sed -e s,\\\\,\\\\\\\\,g -e s,\',\\\\\',g +end + function __fish_abbr_get_by_key if not set -q argv[1] echo "__fish_abbr_get_by_key: expected one argument, got none" >&2