zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Facing issue with simple bash alias: '_zsh_highlight_main__type:13: job table full or recursion limit exceeded'

Open Anatoli-deBRADKE opened this issue 1 year ago • 4 comments

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 image

Do you have any idea of the origin of this issue?

Thanks in advance!

Anatoli-deBRADKE avatar Feb 08 '24 16:02 Anatoli-deBRADKE

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)}"

danielshahaf avatar Feb 11 '24 14:02 danielshahaf

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

Anatoli-deBRADKE avatar Feb 12 '24 08:02 Anatoli-deBRADKE

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.

danielshahaf avatar Feb 13 '24 11:02 danielshahaf

No worries! Many thanks for the workaround, which works perfectly.

Anatoli-deBRADKE avatar Feb 13 '24 14:02 Anatoli-deBRADKE