ZSH on 10.9: widgets can only be called when ZLE is active

6.2k Views Asked by At

I am new to ZSH and have been using oh-my-zsh to rum ZSH on OSX 10.9. I've been trying to take an advantage of a history plugin but I get this, "widgets can only be called when ZLE is active." when invoke any of history related commands. I've looked for a way to circumvent this but have not been able to find a solution.

1

There are 1 best solutions below

1
On

Its a bug in oh-my-zsh. To fix it put this in your .zshrc:

TRAPWINCH() {
  zle && { zle reset-prompt; zle -R }
}

Explanation:

With no options and no arguments, only the return status will be set. It is zero if ZLE is currently active and widgets could be invoked using this builtin command and non-zero otherwise. Note that even if non-zero status is returned, zle may still be active as part of the completion system; this does not allow direct calls to ZLE widgets.