zsh-workers
 help / color / mirror / code / Atom feed
From: Thayne <astrothayne@gmail.com>
To: zsh-workers@zsh.org
Subject: Space in interactive menu select
Date: Sun, 1 Jul 2018 00:25:45 -0600	[thread overview]
Message-ID: <CALbpH+iHCk-j3G+Dq_3_Qx8tKFVnzDPinkgHdoh5DCwxzGvtQg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

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.

Thayne McCombs

             reply	other threads:[~2018-07-01  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01  6:25 Thayne [this message]
2018-07-01  9:44 ` Mikael Magnusson
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=CALbpH+iHCk-j3G+Dq_3_Qx8tKFVnzDPinkgHdoh5DCwxzGvtQg@mail.gmail.com \
    --to=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).