Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How can I debug lost keyboard input?



On Wed, Sep 19, 2018 at 8:27 PM, Andy Spiegl <zsh.Andy@xxxxxxxxx> wrote:
>> Any ideas how I can debug this?
> Unfortunately I still don't know a good way to debug problems like that.
> This time, I found the solution by reading zsh man pages over and over. :-)
>
>> BTW if I bind the functions to a different key the same thing happens.
>> Uhm, as if the function would have to be loaded/initialized on the first try?
>
> Turned out to be exactly that.  On the first call the function file is
> loaded and the function initialized but NOT executed.  So, I added the line
> "zle finer-forward-word" at the end of the function file - after the
> function definition.  And now it works as expected again.  zsh's default
> behavior of this must have changed recently, right?
>
> --------
> finer-forward-word() {
>   local WORDCHARS=$WORDCHARS_FINER
>   zle forward-word
> }
> zle finer-forward-word
> --------
>
> But is that the "correct" way to do it or just a dumb workaround?

Your mails are somewhat unclear, but if you have these functions
defined in autoloadable files then they should look as following
% cat finer-forward-word
local WORDCHARS=$WORDCHARS_FINER
zle forward-word

Ie, do not include the "finer-forward-word() {" and "}" lines in the
file. Your original versions probably work if you use autoload -k, but
you don't show your autoload lines at all in the example.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author