You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
helm completion fails in zsh (prezto) with "bad math expression: operand expected" #5046
I noticed helm completion in zsh is not working.
One part of the problem is that _helm is not executable per default.
Second when I type helm and hit tab I get:
helm _helm_root_command:12: bad math expression: operand expected at `"del"'
I found that removing the doublequotes in _helm at every aliashash key value fixes it.
(/usr/local/Cellar/kubernetes-helm/2.12.0/share/zsh/site-functions/_helm)
not working:
aliashash["del"]="delete"
fixed:
aliashash[del]="delete"
I am using prezto and I installed helm with homebrew.
Reacted by Emilien Mottet, Aldo Armiento, sviatoslav-lebediev, Fabian Hinz, bzub, Thuan Duong, Richard Kemp, Dmitry Verkhoturov, Peter Stalman, Axel Köhler and 51 more
$ source <(helm completion zsh)
$
# Typing 'helm' and hitting "Tab"
$ helm _helm_root_command:12: bad math expression: operand expected at `"del"'
$
$ helm version -c
Client: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
Running ZSH under OSX:
$ zsh --version
zsh 5.3 (x86_64-apple-darwin17.0)
Reacted by Attila Egyed, Louis Cloutier, Adam Dróżdż, Oleksii Kravchenko, Evgeniy Shubin, Andreas Tiefenthaler, Craig Rueda, Peter Matseykanets, Igor Korsun and Luvpreet Singh
source <(helm completion zsh | sed -E 's/\["(.+)"\]/\[\1\]/g')
hope it will fix in the next release. Current rc does not fix it
Reacted by Nikita Zhuravlev, Vladimir Vojneski, Kevin Gibson, Hossein Pursultani, Mohammed Al-Ameen, Koen Punt, Pavel Dmytrenko, Nick Albury, Panagiotis Xynos, Andrzej Lewandowski and 34 more
Reacted by Nikita Zhuravlev, Louis Cloutier, Christian Palmhøj Nielsen, Kevin Gibson, Mohammed Al-Ameen, Zach Norris, Nick Albury, Panagiotis Xynos, Jhuliano Skittberg Moreno, Max Xu and 7 more
Reacted by Nikita Zhuravlev, Kevin Gibson, Mohammed Al-Ameen, Nick Albury, Panagiotis Xynos, Yervand Aghababyan, Troy C., Aleksey Shirokih, Ali Essam, Jhuliano Skittberg Moreno and 12 more
Reacted by Kevin Gibson, Nikita Zhuravlev, Mohammed Al-Ameen, Nick Albury, Panagiotis Xynos, Chris Kleeschulte, Renato Ruis, Alexis Reyes, Bryan Banks, Mike Sigsworth and 1 more
I simply find bash autocompletion gets in my way so I don't use it. Nothing much else to it. 🤷♂️
Generally speaking, I'm testing and/or using several different development builds of Helm any given day, so I'd have to keep switching between different autocompletion scripts for varying versions of Helm. I'm typically context switching between Helm 2 and Helm 3 once every few hours. Again, just getting in the way of my day-to-day workflow.
Turns out that the real root of this bug was that the 'aliashash' associative array was not being declared properly. PR #5680 fixes it and removes the previous fix to the current issue.
Activity
philoserf commentedon Dec 11, 2018
I have confirmed the issue does not appear in helm 2.11.0
This may have been introduced by #4851. It is the only mention of completion in release 2.12.0.
ref: https://github.com/helm/helm/releases/tag/v2.12.0
Sarke commentedon Dec 18, 2018
Same with oh-my-zsh, so the issue seems to be the quotes in the hash maps not being allowed by ZSH.
Here's a diff of the two versions'
helm completion zsh.Fixes helm#5046, zsh completion
scandeezy commentedon Jan 24, 2019
Hey there, I was wondering when this change might make it in? Happy New Year.
pavdmyt commentedon Jan 29, 2019
Having the same issue with helm v2.12.2:
Running ZSH under OSX:
Fixes #5046, zsh completion (#5072)
NZhuravlev commentedon Feb 8, 2019
v2.12.3 - still have the same issue.
helm _helm_root_command:12: bad math expression: operand expected at `"del"'
macOS 10.14.2 (18C54)
zsh 5.3 (x86_64-apple-darwin18.0)
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
eddiezane commentedon Feb 8, 2019
@NZhuravlev this fix made it in after v2.12.3 shipped. You'll unfortunately have to wait for the next release or build from source.
bacongobbler commentedon Feb 8, 2019
Or use the canary releases: https://docs.helm.sh/using_helm/#from-canary-builds
arogarth commentedon Feb 14, 2019
quick local fix in .zshrc...
hope it will fix in the next release. Current rc does not fix it
bacongobbler commentedon Feb 14, 2019
Do you mean to say that the fix proposed in #5072 did not fix the issue? You were testing 2.13.0-rc.1, right?
koenpunt commentedon Feb 16, 2019
When installed through Homebrew you can use the following to fix autocompletion:
Don't forget to reload your shell; this can be done by opening a new window, or by running
exec $SHELLpavdmyt commentedon Feb 18, 2019
@bacongobbler having the same issue with 2.13.0-rc.1:
6 remaining items
bacongobbler commentedon Mar 5, 2019
fixed via #5406, hopefully for real this time! 😄
marckhouzam commentedon Mar 6, 2019
Out of curiosity, how come the maintainers don't use bash completion? I guess you don't actually use helm manually that much?
bacongobbler commentedon Mar 6, 2019
I simply find bash autocompletion gets in my way so I don't use it. Nothing much else to it. 🤷♂️
Generally speaking, I'm testing and/or using several different development builds of Helm any given day, so I'd have to keep switching between different autocompletion scripts for varying versions of Helm. I'm typically context switching between Helm 2 and Helm 3 once every few hours. Again, just getting in the way of my day-to-day workflow.
Fixes helm#5046, zsh completion (helm#5072)
Fixes helm#5046, zsh completion (helm#5072)
Fixes helm#5046, zsh completion (helm#5072)
Fixes helm#5046, zsh completion (helm#5072)
Fix helm#5046 compatible with MacOS (helm#5406)
Fix helm#5046 compatible with MacOS (helm#5406)
Fixes helm#5046, zsh completion (helm#5072)
Fix #5046 compatible with MacOS (#5406)
(helm): Proper fix for helm#5046
marckhouzam commentedon May 20, 2019
Turns out that the real root of this bug was that the 'aliashash' associative array was not being declared properly. PR #5680 fixes it and removes the previous fix to the current issue.
add customize helm plugin