From 49008d7a1c576167f000f212eb7c55701283af55 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 26 Jul 2016 15:23:02 +0200 Subject: [PATCH] Fix escaping in `abbr --erase` completions Fixes #3267 --- share/completions/abbr.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/completions/abbr.fish b/share/completions/abbr.fish index 3ce166fc7..05e4feeb4 100644 --- a/share/completions/abbr.fish +++ b/share/completions/abbr.fish @@ -1,5 +1,7 @@ complete -c abbr -f -s a -l add -d 'Add abbreviation' -complete -c abbr -s e -l erase -d 'Erase abbreviation' -xa '(abbr -s | cut -d" " -f 2- | sed -e "s/ / /")' +# Abbr keys can't contain spaces, so we can safely replace the first space with a tab +# `abbr -s` won't work here because that already escapes +complete -c abbr -s e -l erase -d 'Erase abbreviation' -xa '(string replace " " \t -- $fish_user_abbreviations)' complete -c abbr -f -s s -l show -d 'Print all abbreviations' complete -c abbr -f -s l -l list -d 'Print all abbreviation names' complete -c abbr -f -s h -l help -d 'Help'