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.
Asked
Active
Viewed 5,878 times
16
-
Run `zmodload` in a shell and check whether `zsh/zle` is listed. If it's not, you'll need to load it before the `oh-my-zsh` plugin. You can do this in `~/.zshrc` *before* the `source oh-my-zsh` line: `zmodload zsh/zle`. – simont Dec 06 '13 at 06:26
-
4A result of zmodload shows that zle is loaded but I am still getting the same error, "widgets can only be called when ZLE is active." how else can I activate ale ? – user1836430 Mar 12 '14 at 20:31
1 Answers
4
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.

boojum
- 669
- 2
- 9
- 31
-
3I added your code to my .zshrc file, sourced it, but I am still having an error message saying "zle: widgets can only be called when ZLE is active". zmodload shows that zle is loaded. – politicus Jan 22 '19 at 02:39