abbr: Stop escaping the name for abbr --list

This is so we can pass it to `abbr --erase`.

Fixes #9470
This commit is contained in:
Fabian Boehm 2023-01-13 16:38:34 +01:00
parent 572a568268
commit 1b1cf73b60
2 changed files with 7 additions and 1 deletions

View file

@ -139,7 +139,7 @@ static int abbr_list(const abbr_options_t &opts, io_streams_t &streams) {
}
const auto abbrs = abbrs_get_set();
for (const auto &abbr : abbrs->list()) {
wcstring name = escape_string(abbr.name);
wcstring name = abbr.name;
name.push_back(L'\n');
streams.out.append(name);
}

View file

@ -180,7 +180,13 @@ echo erase $status
set --show _fish_abbr_cuckoo
# Nothing
abbr --add '$PAGER' less
abbr --erase (abbr --list)
abbr --list
# Nothing
abbr --add '$PAGER' less
abbr --list
# CHECK: $PAGER
abbr --add bogus --position never stuff
# CHECKERR: abbr: Invalid position 'never'