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

Re: A serious bug in execution – where to debug?

On Tue, 30 Jul 2019 at 19:42, Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
> > - print before the call does output, after the call – doesn't (as
> > arranged as in here: http://psprint.blinkenshell.org/zle-exit-fun.png)
> > - the plugin's following zle -F {descriptor-#} call reports error:
> > --zplg-shadow-zle:zle:64: No handler installed for fd 21
> > meaning that the execution didn't really reach the point where an
> > actual builtin zle is being called by the shadowing function.
> Perhaps because of this?
> https://github.com/romkatv/powerlevel10k/blob/f14497918f0a70955f6d227d1e002ad2a3f94cc8/gitstatus/gitstatus.plugin.zsh#L302-L307

Nice argument, however this doesn't explain:
- why the actual zle -F isn't called in the later of the prematurely
exited function,
- why changing the meaningless line in the return-causing function
cancels the effect.

> Feel free to send me a PR replacing `zle` calls in this file with
> `builtin zle`. I suppose you aren't shadowing `builtin` for good
> measure?

Yes, implementation of plugin effects withdrawal (i.e. unloading)
bases on this. I saw that your initialization of the prompt is called
from precmd, where the shadowing isn't active. So (today) I've
implemented: on-demand wrapping of any function call with the
shadowing-enabling code, and then after a single call unwrapping. This
way I'm able to unload your plugin.

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