Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Space in interactive menu select
- X-seq: zsh-workers 43117
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Thayne <astrothayne@xxxxxxxxx>
- Subject: Re: Space in interactive menu select
- Date: Sun, 1 Jul 2018 11:44:36 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6aHwX8ugLbCjN9XrCzttiJoAnp/zNfbnEVyqhpWmJQg=; b=JuYjQmvxhpWhFbthCNmRY3T/zzEXsWBxwZEGSYxr5a/xXWiD2htjj6zi9fFgndfGwy 5wq/X8uhy7EVSRUJ7LyAz8cJ26nqyCtTMUJF01GwtAOZm7jD7EzDw/1G8J1OqoarZbAX jyaB67pIanlF19U8YM7WM+CBZdKGMK7GXVNa6oLpVFFteEd/JGkEpTYuRWpsEfT/ZUid M/t1xFLdoZUvHZCakG2fyzxplgbdmeqFkdRVoeMn8ep4wTlla251CwbCeWrEnnDn2cu8 bfbDUOMRKPqxtFS13FXGwIeOenT1zB66r5ADvett/odGvMlAdXDEVZd0pqOaXiGj/ff7 ohZg==
- In-reply-to: <CALbpH+iHCk-j3G+Dq_3_Qx8tKFVnzDPinkgHdoh5DCwxzGvtQg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CALbpH+iHCk-j3G+Dq_3_Qx8tKFVnzDPinkgHdoh5DCwxzGvtQg@mail.gmail.com>
On Sun, Jul 1, 2018 at 8:25 AM, Thayne <astrothayne@xxxxxxxxx> wrote:
> With the following (minimal) .zshrc:
>
> zmodload zsh/complist
> zstyle ':completion:*' menu select yes interactive
> autoload -Uz compinit
> compinit
>
> If I finish the word that is being completed myself, then press space, it
> starts completing for the next word, but if I then accept a completion for
> that word, it then replaces *both* words that I typed during completion.
> https://asciinema.org/a/189304 shows an illustration of this.
>
> This is very unexpected behaviour. I would expect pressing a space during
> interactive menu selection to stop the current completion and insert a
> space after what has been typed so far. Or at least that is how I would
> like it to happen, but as far as I can tell there isn't a way to accomplish
> that.
>
> I have tried using `bindkey -M menuselect ' ' self-insert`, but that
> doesn't make a difference. `bindkey -M menuselect ' ' accept-line` makes it
> so a space is treated the same as enter, which is less surprising, but is a
> little annoying if I start the completion, realize that the completion
> doesn't have the option I actually need, type the real option, then press
> space.
>
> I've also tried creating a custom zle widget that calls `zle send-break`
> and then `zle self-insert`. And bind space to that widget, but that doesn't
> work either (it looks like it acts the same as `accept-line`.
>
> This seems like a bug to me.
You can't really just treat the space key as a special case here,
consider completion inside a quote which won't end the current word.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author