help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Andrea Manenti <andrea.manenti@yahoo.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] complist interactive mode overwrites command line
Date: Sat, 16 Jul 2022 11:11:53 -0700	[thread overview]
Message-ID: <CAH+w=7Zq-0X1DnSW7vORP5B64PN0pzQ2UX2bDfWk8405YDXfrA@mail.gmail.com> (raw)
In-Reply-To: <8964126.CDJkKcVGEf@phy-nordri>

On Fri, Jul 15, 2022 at 6:45 AM Andrea Manenti <andrea.manenti@yahoo.com> wrote:
> On Wed, 4 Aug 2021 19:30:10 +0300 Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> > % zmodload zsh/complist
> > % bindkey '^I' menu-select

I don't know if this is also a new thing, but menu-selection also
makes the display pretty confused when stepping through with the arrow
keys if some of the entries are longer than will fit on the command
line without wrapping at the right margin.  Try it in a directory with
a mix of very long and very short file names.

> > % MENUMODE=interactive
> > % touch test{1,2}
> > % : ; foobar
> >     ^ 1. Type the above line in its entirety.
> >       2. Place the cursor before the ;
> >       3. Press Tab.
> >       4. Press Enter.
> > % : test1 bar
> >     ^ Completion is written over existing buffer contents.

> I am also experiencing this bug, I'm running zsh 5.9.

The issue seems to be that interactive mode assumes you're going to
use it interactively -- as in, type a single character at a time until
you've reduced the set to only one match -- so it only adjusts the
buffer spacing on single keystrokes.  When you accept with TAB (or
ENTER) domenuselect() is relying on do_single() to fix everything up,
but the state required by do_single() is not fully populated.  I don't
know precisely what else is needed, though, and am out of time to
study it today.

> autoload -Uz compinit
> compinit
> setopt noautomenu
> setopt globcomplete
> bindkey '^i' complete-word
> setopt nolisttypes
> zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
> zstyle ':completion:*' menu yes select interactive

This configuration doesn't appear to matter to the underlying issue.

  reply	other threads:[~2022-07-16 18:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8964126.CDJkKcVGEf.ref@phy-nordri>
2022-07-15 13:39 ` Andrea Manenti
2022-07-16 18:11   ` Bart Schaefer [this message]
2022-07-16 22:57     ` Bart Schaefer
     [not found]       ` <2844417.e9J7NaK4W3@phy-nordri>
2022-07-22 16:32         ` Bart Schaefer
2022-07-22 17:55           ` Bart Schaefer
2022-07-22 18:23             ` Bart Schaefer
2022-07-22 19:10               ` Andrea Manenti
2021-08-04 16:30 Marlon Richert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Zq-0X1DnSW7vORP5B64PN0pzQ2UX2bDfWk8405YDXfrA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=andrea.manenti@yahoo.com \
    --cc=zsh-workers@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).