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

[BUG] REPORTTIME parsed as 0 with error in zle widget



Given the following zle widget:

    __fsel() {
      exit 130 | while read item; do
        :
      done
    }
    mywidget() {
      LBUFFER="${LBUFFER}$(__fsel)"
    }
    zle     -N   mywidget
    bindkey '^r' mywidget


TEST CASE:
1. source it
2. set REPORTTIME=5
3. run it (ctrl-r)

RESULT:
time gets reported, but should not


getintvalue in should_report_time returns 0, although getstrvalue(v) is "5"!
This is caused by errflag being set in matheval, which makes it return 0!
And this gets caused by "exit 130" in __fsel.
I've noticed this with fzf and its widgets, where 130 is returned when selecting nothing.

btw: for fzf it makes sense to unset REPORTTIME like it has been done recently for completion functions already.


Cheers,
Daniel.

Attachment: signature.asc
Description: OpenPGP digital signature



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