Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zstyle ':completion:*' menu select=4 interactive
- X-seq: zsh-users 26170
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Thomas Lauer <thomas.lauer@xxxxxxxxxx>
- Subject: Re: zstyle ':completion:*' menu select=4 interactive
- Date: Mon, 16 Nov 2020 17:47:24 +0000
- Archived-at: <https://zsh.org/users/26170>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-11/20201116174724.29df11d1%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (out3-smtp.messagingengine.com) smtp.remote-ip=66.111.4.27; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=Zm+FhN8Tg1FSJuzI7rknbXM03q jNpRpfn5IryTao/VY=; b=bMzaP9DjL8H2uV3cVHkM8R8DYBVoE7PJUsNkcGx2f0 9A7kOW7zvSSCvoWyffXfMLB6zE0Cpouo6Ym3GNJBJmG1Hio4CLFRZpK4VV4jj8xE kDXSnQTaj9so7cVZHn+BVVMqywwsbvyHEhDtODHoIi+caEHkANFnkRe0lEVCeXwq OYvwJbXDpZCplT1fNX02O4M2U3H6uzj3nuZAqQSGflBfbBLDrz4SPpqS/tlRHJyd srZVBbCSAcEkzMdfKqAEMAqPY59S23aQ5TXI+BY+jPL9fymtPbUH7lsI8wzxClXg 8tGzaQSpgW4qfy8ASdCtMvM4JK03vaQt+SlKlxd6KFOw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Zm+FhN8Tg1FSJuzI7rknbXM03qjNpRpfn5IryTao/ VY=; b=Da1GC/CNuBMHFbzsh6qp+Vt6a7bdkPRsF+3uf4pJ0x6oV9agRAsh0Obum YvIBv8WXpWqtf5pXP14rjBtSFCuvfw+CV0zw1p1XhY1w13H5CyTpaY3Qij1KKHDP 5/ushl5XJ/Ewu67XpiK/eJ8+tOX7HdbCe6jqUUmLL3BUApJns/U8an+pVdESQ8V/ 0jypp2s0kfTqJW5Ks71Lpzk4VbeqDWepKMHt8DKzajRx6rWOAxnLYXXlwp0oy3m5 ISySjVBP4VRdnwgSBgQm6RxUlwgdkUkqRanBl0GjogU8+HBAN2WeKMQooDiUt6ca /BASMcMfQ4A6KDGDjVkVZPAL+ZT3Q==
- In-reply-to: <20201114103621.50ca012e079ba3bcd78a25a4@virgin.net>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <20201114103621.50ca012e079ba3bcd78a25a4@virgin.net>
- Sender: zsh-users-request@xxxxxxx
Thomas Lauer wrote on Sat, 14 Nov 2020 10:36 +0000:
> Here's another long-standing problem I am having with zsh. I have
> googgled for hours but found nothing (Google search these days is like
> a cat: it brings home loads of things it thinks will please you but
> which are not really what you were looking for. Google just knows
> better than we do what we're searching for... But I digress.).
>
> I have the subject line in my .zshrc (BTW this is 5.7.1). The tab is
> bound to expand-or-complete-prefix. The trouble starts when the
> interactive part of this kicks in, ie there are four or more items (if
> there are fewer, all works fine) and if the cursor is somewhere in the
> middle of a line I am editing.
>
> So I do get the menu and I start navigating, with my current choice
> being copied into the line that's edited. The problem is that this
> choice overwrites part of the line I am editing. Consider this:
>
> $ bla D<tab> somestuff # cursor behind the D when I press tab)
>
> I get a few choices (say "D1/ Documents/ Dz2/ Dz3/ ..."), but nothing is
> as yet inserted into the line. Now I press <right> and "Documents/" gets
> inserted, overwriting the first few characters of somestuff. The line
> now looks like this:
>
> $ bla Documents/estuff # cursor behind the /)
>
What happens if you press ^L (clear-screen) at this point?
Can you reproduce this from 'zsh -f'?
> Not what I want. So I have done an ugly hack to sort of solve this:
>
> ugly() {
> [[ ! -z $RBUFFER ]] && RBUFFER=" $RBUFFER"
> zle expand-or-complete-prefix
> }
> ...
> zle -N ugly
>
> with ugly() bound to the tab key. This (sort of) works but it's
> pretty 'orrible.
>
Well, for starters:
ugly() {
local save_RBUFFER=$RBUFFER
RBUFFER=
{ zle expand-or-complete-prefix -- "$@" } always { RBUFFER=$save_RBUFFER }
}
Not tested.
> I'm sure the zsh gurus have an idea what's going on here and can
> point out the problem :-)
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author