]> git.ipfire.org Git - thirdparty/systemd.git/commit
zsh: remove usage of PREFIX in _systemctl
authorRonan Pigott <ronan@rjp.ie>
Fri, 5 May 2023 19:33:29 +0000 (12:33 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 5 May 2023 21:12:50 +0000 (22:12 +0100)
commit8139407ec109594c11c8c7d2936e9f0eba610f05
tree09e9de8b8f890148a952b1e81cf4cb48d5e0d4fd
parent362235bf59f8ddc6d67be3d6c8604f7fd05d383d
zsh: remove usage of PREFIX in _systemctl

The usage of PREFIX in this completion is mostly counter to the intended
usage of compsys in zsh. It is generally expected that completion code
provide the available completions and tags in that word position so that
compsys, with user configuration, can filter them to the appropriate set.

One egregious error caused by the usage of PREFIX here is the caching of
SYS_ALL_UNITS, which stored only the unit names prematurely filtered by
the completion prefix, affecting all future completions. For example,

  $ systemctl cat nonsense<TAB>

might find no matching units if nonsense* has no matches, but now

  $ systemctl cat <TAB>

will fail in all future completions even though every unit file
is a valid match, because the cached set has been erroneously filtered
by the last prefix.
shell-completion/zsh/_systemctl.in