From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2259 invoked by alias); 1 Jul 2018 09:44:43 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43117 Received: (qmail 18919 invoked by uid 1010); 1 Jul 2018 09:44:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-ed1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.208.54):SA:0(-1.9/5.0):. Processed in 1.60177 secs); 01 Jul 2018 09:44:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6aHwX8ugLbCjN9XrCzttiJoAnp/zNfbnEVyqhpWmJQg=; b=gUG6OQwo6P5f7B5vNCTUVem12h6p7BAplcRTXFnIyWoBPkXGy8FgkuMFHAOWVKTvaK 008KMyO4bCC74b2N7DsqRsnfPpKGpeyOOH75E95pmgXzjvwoauBDEsg2VDhEQYRVU5lY PUKv2mt03sOa/3djCJAAS2OTSxxhkHlP3Iq8J268qxBoxBck8m8M9F9yOvCd2N9FuPy/ IAfa74x7WR/bVZZbwfBtUldgrCj3C8HtmfFlF8u2RGub1TaxuCd2t6ny1a/EwC3fPbAF VIrjtPaynIRMqJAcjpZTkr6wV/6vB3HEt8C1TVrmaW/9jygQjDck1dhxiLMyjXfAML3z doQA== X-Gm-Message-State: APt69E0Sjxkg4AmmftAiHLvIm/O4AV4C/6Xfljey9ocuUcokqPlcl/9p LDXFpVrbVd3LOcNfPj4NQ8AuhTaEkrlS3AbjZlE= X-Google-Smtp-Source: AAOMgpea/wCb4mYx/FefOLc7k3yhrKDQ1L4DAiMKMnRjVqp8TL7BfLwrm98Mt/DDdpUb6swezSdfseRYMafVn5zNoiU= X-Received: by 2002:a50:8466:: with SMTP id 93-v6mr19680857edp.304.1530438276865; Sun, 01 Jul 2018 02:44:36 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Mikael Magnusson Date: Sun, 1 Jul 2018 11:44:36 +0200 Message-ID: Subject: Re: Space in interactive menu select To: Thayne Cc: zsh workers Content-Type: text/plain; charset="UTF-8" On Sun, Jul 1, 2018 at 8:25 AM, Thayne 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