ohmyzsh: ZSH Complaints "bad set of key/value pairs for associative array" for Completion of Service Name for systemctl
Describe the bug
The zsh complaints “_systemctl_unit_state: bad set of key/value pairs for associative array” when I typed in “systemctl enable blu” and then press TAB for completion.
To Reproduce
From a clean install of ohmyzsh:
- Type “systemctl enable blu” (where I supposed to type “systemctl enable bluetooth.service” as completion)
- Press TAB
- See error
Expected behavior
I think the complaints “_systemctl_unit_state: bad set of key/value pairs for associative array” should not be occurred here and the command (service name) should be completed.
Screenshots and/or Recordings
$ systemctl enable blue
_systemctl_unit_state: bad set of key/value pairs for associative array
_systemctl_unit_state: bad set of key/value pairs for associative array
_systemctl_unit_state: bad set of key/value pairs for associative array
Desktop (please complete the following information):
- OS / Distro: Arch Linux
- Latest ohmyzsh Update?: Yes
- ZSH Version: zsh 5.8 (x86_64-pc-linux-gnu)
- Terminal emulator: gnome-terminal
Additional context
I’ve also tried to remove the .zcompdump* files but it still does not work.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 15 (6 by maintainers)
Commits related to this issue
- fix https://github.com/ohmyzsh/ohmyzsh/issues/8751 — committed to GopherJ/dotfiles by GopherJ 3 years ago
While a fix makes it into a new release, you could redefine the
_systemctl_unit_statefunction to only use the first two columns:I think copy/pasting the above function into the bottom of
~/.zshrcdoes the job.