Zsh-autosuggestions: "Bad Math Expression"

Created on 17 Apr 2019  路  6Comments  路  Source: zsh-users/zsh-autosuggestions

I just updated this through pacman on Arch Linux. I opened my terminal and I'm getting this error every time I type something in to it:
_zsh_autosuggest_modify:49: bad math expression: operand expected at end of string

According to pacman I am running 0.5.2-1:
community/zsh-autosuggestions 0.5.2-1

bug has-workaround reproduced

Most helpful comment

I was having the same issue, using zgen, on both SUSE and NixOS -- but only in the shell that I did the update in. Opening other shells, or reloading .zshrc or running exec zsh in the misbehaving shell, fixed it. Sorry I can't be of help reproducing.

All 6 comments

Looks like something to do with this line: https://github.com/zsh-users/zsh-autosuggestions/blob/733abd4af0f23f217caa2a303fbef66382d19d6f/src/widgets.zsh#L88

I will need some more info on your setup since I'm not able to reproduce.

Are you able to reproduce this using zsh -f and sourcing the plugin manually?

I was having the same issue, using zgen, on both SUSE and NixOS -- but only in the shell that I did the update in. Opening other shells, or reloading .zshrc or running exec zsh in the misbehaving shell, fixed it. Sorry I can't be of help reproducing.

Hi,
I am also having the same issue on Arch Linux after the update. What more information can I provide.
Running zsh -f works fine without any issue.

I was also having the same problem after the v0.5.2 release, I wasn't using any framework nor plugin manager but I had this line set in my dotfiles.

typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=''

Setting it to a value fixes the problem.

typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE='20'

Thanks @kutsan, that reproduces it.

Current code expects it to either be unset or be set to a number. I'll get a change ready to silently ignore it if it's not a number, but for now the quick workaround is to either remove the line or set it to a number.

https://github.com/zsh-users/zsh-autosuggestions#disabling-suggestion-for-large-buffers

Should be fixed now on develop branch. Will go out in the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kenmmm picture Kenmmm  路  4Comments

moritzschaefer picture moritzschaefer  路  5Comments

metalmac picture metalmac  路  4Comments

kergoth picture kergoth  路  3Comments

raulferras picture raulferras  路  3Comments