Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Zsh crashes when reverse-menu-complete is invoked during complist MENUSELECT without 'menu:' in $compstate[insert]
- X-seq: zsh-workers 48954
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] Zsh crashes when reverse-menu-complete is invoked during complist MENUSELECT without 'menu:' in $compstate[insert]
- Date: Sun, 30 May 2021 01:38:13 +0200
- Archived-at: <https://zsh.org/workers/48954>
- In-reply-to: <CAHLkEDvSRo6fOFhvS2A+qN4WAUJpD=jo6mO-faTUFDECc2m1ZQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDvSRo6fOFhvS2A+qN4WAUJpD=jo6mO-faTUFDECc2m1ZQ@mail.gmail.com>
On 27 May, Marlon Richert wrote:
> Given:
> * complist's MENUSELECT mode is active
> * $compstate[insert] does not start with 'menu:'
> When:
> * The user activates reverse-menu-complete.
> Then:
> * Zsh crashes.
It calls reversemenucomplete() which is a function that pre-dates menu
selection. The path down which it clears minfo didn't look appropriate
from within menu selection. But it doesn't crash for forward menu
completion. Taking the same code path as for forward completion but
with zmult negated appears to work fine and would seem logical enough.
But perhaps there's some aspect to reversemenucomplete() that would be
needed so it'd be good if this can get some further testing.
Oliver
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 429c8159f..353cb3562 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -3277,9 +3277,8 @@ domenuselect(Hookdef dummy, Chdata dat)
!strcmp(cmd->nam, "reverse-menu-complete")) {
mode = 0;
comprecursive = 1;
- unmetafy_line();
- reversemenucomplete(zlenoargs);
- metafy_line();
+ zmult = -zmult;
+ do_menucmp(0);
mselect = (*(minfo.cur))->gnum;
setwish = 1;
mline = -1;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author