diff options
author | bryango <bryango@users.noreply.github.com> | 2024-08-15 07:18:17 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-08-15 20:28:12 +0200 |
commit | 3ceb4d243818fa96741979620ca86cc126bd3e4d (patch) | |
tree | 7ecec24cdec13895b3bc3fd38225e3216750708e /shell-completion/zsh | |
parent | udev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to check of_node of n... (diff) | |
download | systemd-3ceb4d243818fa96741979620ca86cc126bd3e4d.tar.xz systemd-3ceb4d243818fa96741979620ca86cc126bd3e4d.zip |
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
Diffstat (limited to 'shell-completion/zsh')
-rw-r--r-- | shell-completion/zsh/_systemctl.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index df9045f229..a5a16b3fdb 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -190,7 +190,7 @@ __systemctl() local -a units; units=("${(q-)@}") local -A props props=(${(f)"$(_call_program units "$service $_sys_service_mgr show --no-pager --property=\"Id,$property\" -- ${units} 2>/dev/null")"}) - echo -E - "${(@g:o:)${(k@)props[(Re)$property=$value]}#Id=}" + echo -E - "${(@)${(k@)props[(Re)$property=$value]}#Id=}" } (( $+functions[_systemctl_get_non_template_names] )) || |