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

Re: Where to start debugging zle recursive-edit? / Ctrl-C



On 24 September 2016 at 22:31, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 23,  6:26pm, Sebastian Gniazdowski wrote:
> }
> } I use a POSTDISPLAY interface for Ctrl-R, that works inside
> } .zle-recursive edit. Occurring problems with Ctrl-C every day.
> } [...] Funny that it became much more intensive after adding
> } few custom keymap's bindings for left/right cursors
>
> This probably means that the ^C is arriving while zle is waiting
> to see if a binding has multiple "keystrokes" before determining
> what widget to call.

That would explain what at first glance looks surprising.

> Does emacs mode vs. viins or vicmd matter?  Does (un)setopt multibyte?

I create custom keymap from emac's:

https://github.com/psprint/history-search-multi-word/blob/master/history-search-multi-word#L155

Rather hard to test viins and vicmd? Might try with multibyte when I
spot this happening and repeating. And one session now had this. Doing
unsetopt multibyte stopped this, restoring the option didn't cause the
issue to come back.

> } Also one user reports that Ctrl-C crashes Zsh.
>
> If this is with the latest build from git, it might be related to
> the recently-introduced signal-handling problem with functions that
> Daniel and I have been discussing elsewhere.

It's 5.1.1, and I've tested rather identical setup in coincidence:

https://github.com/psprint/history-search-multi-word/issues/2

Proposed a possible fix but user didn't respond if it helped:

- bindkey -N zhcw main
+ bindkey -N zhcw emacs

> } Would add a debug print somewhere and observe, then extend the
> } debugging. But where?
>
> You're probably interested in getbyte() in zle_main.c, but you might
> also attach with a debugger and put a breakpoint in zhandler so you
> can get a stack trace of where the handler is being called [if it is].
> (Starting the debugger first and running zsh inside it won't work as
> well because the debugger itself will trap the signals).

Thanks, will sure get on that tomorrow. I also sometimes get crashes.
Terminal window closes. Any tips for generating coredumps on OS X? I'm
able to google that when will have time, but also wanted to disable
-O, and ./configure --help | grep -i opt didn't show any option.

Best regards,
Sebastian Gniazdowski



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