zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Thayne <astrothayne@gmail.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Space in interactive menu select
Date: Sun, 1 Jul 2018 11:44:36 +0200	[thread overview]
Message-ID: <CAHYJk3Qji+L7k2FRyGVxePaYNYmwWMRBs6JuhSKg6-AFRwR_bg@mail.gmail.com> (raw)
In-Reply-To: <CALbpH+iHCk-j3G+Dq_3_Qx8tKFVnzDPinkgHdoh5DCwxzGvtQg@mail.gmail.com>

On Sun, Jul 1, 2018 at 8:25 AM, Thayne <astrothayne@gmail.com> 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


  reply	other threads:[~2018-07-01  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01  6:25 Thayne
2018-07-01  9:44 ` Mikael Magnusson [this message]
2018-07-01 15:18   ` Thayne
2018-07-02  5:11     ` Thayne

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=CAHYJk3Qji+L7k2FRyGVxePaYNYmwWMRBs6JuhSKg6-AFRwR_bg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=astrothayne@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.vuxu.org/mirror/zsh/

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).