zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.55k stars 1.32k forks source link

Update is-at-least 5.8.0.* calls for the release of zsh-5.8.1 #856

Closed danielshahaf closed 2 years ago

danielshahaf commented 2 years ago

The following two checks:

https://github.com/zsh-users/zsh-syntax-highlighting/blob/c10808ad5f3ace0696f900b9c543172bc1f8e27c/zsh-syntax-highlighting.zsh#L159-L166

https://github.com/zsh-users/zsh-syntax-highlighting/blob/c10808ad5f3ace0696f900b9c543172bc1f8e27c/zsh-syntax-highlighting.zsh#L416-L418

were written when zsh-5.8 was the current release. zsh-5.8.1 has just been released as zsh-5.8 plus a handful of patches (none of which affect us). Those two conditions should be updated so they return false on zsh-5.8.1.

danielshahaf commented 2 years ago

If someone runs z-sy-h under zsh-5.8.1 (fairly likely to happen soon, since it's a security release), then both conditions would false positive.


The first condition would cause the memo feature to be used, which would be a problem:

https://github.com/zsh-users/zsh-syntax-highlighting/blob/c10808ad5f3ace0696f900b9c543172bc1f8e27c/zsh-syntax-highlighting.zsh#L176-L182

However, as the comment above the first condition explains, that condition is likely to only be evaluated at all during test suite runs, so this is less of a priority.


The second condition would enable the redrawhook codepath even though the memo feature isn't available. Per the comments above that condition, I assume this would reintroduce #579 and #735 for users of 5.8.1 until we fix this condition again.