zsh-syntax-highlighting
zsh-syntax-highlighting copied to clipboard
Facing issue with simple bash alias: '_zsh_highlight_main__type:13: job table full or recursion limit exceeded'
Hello,
I have defined the following alias in my ~/.zshrc
alias kubectl="kubectl --context \${KUBE_CONTEXT:-\$(command kubectl config current-context)}"
and after executing the following command line:
$ aws-vault exec aws-legacy-production
the following error message appears as soon as I have finish to write kubectl in my prompt
Do you have any idea of the origin of this issue?
Thanks in advance!
Hi, I have no time to debug this right now, but you should be able to workaround by changing kubectl to ${:-kubectl} within the alias expansions (let's say both instances to be on the safe side).
Also, what version of z-sy-h and zsh are you running? Asking to see whether you have this https://github.com/zsh-users/zsh-syntax-highlighting/blob/e0165eaa730dd0fa321a6a6de74f092fe87630b0/highlighters/main/main-highlighter.zsh#L706-L707
alias kubectl="kubectl --context \${KUBE_CONTEXT:-\$(command kubectl config current-context)}"
Hello @danielshahaf and thanks for your answer!
I'm sorry but i'm not sure to understand the proposed workaround, can you give me a little bit more details please? Thanks in advance!
I'm using the following version of packages: zsh 5.9 (arm-apple-darwin23.0.0) zsh-syntax-highlighting 0.8.0
Try changing this:
alias kubectl="kubectl --context ${KUBE_CONTEXT:-$(command kubectl config current-context)}"
to this:
alias kubectl="${:-kubectl} --context ${KUBE_CONTEXT:-$(command ${:-kubectl} config current-context)}"
Excuse brevity.
No worries! Many thanks for the workaround, which works perfectly.