]> git.ipfire.org Git - thirdparty/systemd.git/commit
shell-completion: zsh: fix incorrect unescaping
authorbryango <bryango@users.noreply.github.com>
Thu, 15 Aug 2024 05:18:17 +0000 (13:18 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 15 Aug 2024 18:28:12 +0000 (20:28 +0200)
commit3ceb4d243818fa96741979620ca86cc126bd3e4d
tree7ecec24cdec13895b3bc3fd38225e3216750708e
parent24c2e04e9a3b53bc8a57ac4a7a89d8da8e4feb72
shell-completion: zsh: fix incorrect unescaping

Previously the `_filter_units_by_property` completion function
outputs with a [zsh parameter expansion flag] `g:o:`. This means
that the returned result is unescaped as the zsh builtin `echo`,
except that octal escapes don’t take a leading zero. This seemed to
have worked back in the days when it was first introduced:

  6c9414a700a040be1d3160bd2336baac58a1da3e

But it now leads to incorrect over-unescaping; for example,

  system-systemd\\x2djournald.slice (correct)

is incorrectly completed by zsh in commands such as
`systemctl kill`:

  system-systemd-journald.slice (incorrect)

This commit fixes such problems by removing the `g:o:` flag.

See:
[zsh parameter expansion flag]: https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion-Flags
shell-completion/zsh/_systemctl.in