When trying to use the theme on zsh, we obtain multiple errors everytime it tries to display an arrow.
lp_terminal_format:11: bad math expression: operator expected at `195 0'
lp_terminal_format:13: bad math expression: operator expected at `195 0'
lp_terminal_format:15: bad math expression: operator expected at `195 0'
lp_terminal_format:17: bad math expression: operator expected at `195 0'
Apparently this might be related to the way zsh "expands" strings when given as arguments to a new function. For instance here:
In Bash this is equivalent to lp_terminal_format 0 195 0 while in zsh it is lp_terminal_format "0 195 0". The second version both fails in bash and zsh if you try to type it in the command line, because lp_terminal_format expects 3 arguments.
One way to fix that in zsh is to use the z modifier like this: lp_terminal_format ${(z)color}. Unfortunately this is not compatible with bash, meaning we will have to test the environment everytime using _LP_SHELL_zshand _lp_SHELL_bash, making the code way more cumbersome.
There might be a better way to fix that that I’m not aware of.
When trying to use the theme on zsh, we obtain multiple errors everytime it tries to display an arrow.
Apparently this might be related to the way zsh "expands" strings when given as arguments to a new function. For instance here:
https://github.com/nojhan/lp-gitcrux/blob/623edecd0c0accfc8375b394e5828c4ff4cfaa0e/gitcrux.theme#L48
In Bash this is equivalent to
lp_terminal_format 0 195 0
while in zsh it islp_terminal_format "0 195 0"
. The second version both fails in bash and zsh if you try to type it in the command line, because lp_terminal_format expects 3 arguments.One way to fix that in zsh is to use the z modifier like this:
lp_terminal_format ${(z)color}
. Unfortunately this is not compatible with bash, meaning we will have to test the environment everytime using_LP_SHELL_zsh
and_lp_SHELL_bash
, making the code way more cumbersome.There might be a better way to fix that that I’m not aware of.