mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
__fish_complete_list: only unescape "$(commandline -t)"
Commit cd3da62d24 (fix(completion): unescape strings for __fish_complete_list,
2024-09-17) bravely addressed an issue that exists in a lot of completions.
It did so only for __fish_complete_list. Fair enough.
Unfortunately it unescaped more than just "$(commandline -t)".
This causes the problem described at
https://github.com/fish-shell/fish-shell/issues/11508#issuecomment-2889088934
where completion descriptions containing a backslash followed by "n" are
interpreted as newlines, breaking the completion parser. Fix that.
This commit is contained in:
@@ -19,12 +19,12 @@ where:
|
||||
end
|
||||
switch $pat
|
||||
case "*$div*"
|
||||
for i in (echo $pat | sed "s/^\(.\+$div\)$iprefix.*\$/\1/")$iprefix(eval $cmd)
|
||||
string unescape -- $i
|
||||
for i in (string unescape -- $pat | sed "s/^\(.\+$div\)$iprefix.*\$/\1/")$iprefix(eval $cmd)
|
||||
printf %s\n $i
|
||||
end
|
||||
case '*'
|
||||
for i in $prefix$iprefix(eval $cmd)
|
||||
string unescape -- $i
|
||||
printf %s\n $i
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user