Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

zsh

zsh-zle

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.

like image 546
user1836430 Avatar asked Dec 03 '13 17:12

user1836430


People also ask

What is ZLE in Zsh?

The Zsh Line Editor (ZLE) is the command prompt where you can write and edit your commands. The main keymap is the set of keystrokes which is loaded by default when Zsh is launched. The global keymap is the one used to edit commands in Zsh.

What is ZLE?

Zero-latency enterprise (ZLE) is any strategy that exploits the immediate exchange of information across technical and organizational boundaries to achieve business benefit. For example, technical boundaries exist between different operating systems, database management systems and programming languages.


1 Answers

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.

like image 192
boojum Avatar answered Sep 19 '22 18:09

boojum