Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: select w.o. ENTER
- X-seq: zsh-users 30645
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: select w.o. ENTER
- Date: Wed, 6 May 2026 11:16:30 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SQHeJtCDMnSc9qgdE5xYnaMEVRMHxgvSVFzFRNNMUTE=; fh=D6X9xIaVjTSxb6gwuCseglo0uxyISp24IsyxMp5sRU4=; b=jME+dNfUXSmYLLaCrKvndXUZ4cxiLSaUwgsnUwC90DEMG1BHuT1SMlYp22DwC/sBZP O/IZ3Q9utwtXTA7pD887xCML2jMaDr2h+VTLeceJXH0sYyI2r8EXSgqBbBjy0hVO+TPR x0zA665BK0F5gB9RZ5L8sdyYSycZAWWyKRN/i6kfw6XKoS0Tx9klZEDCL90axkJv8nrW GNCIyGBVKj9UpYDQnfhhq1I2qcQE5ora0PdzQgKEbJO46jQNkGvYtEKV32ezCeooodKo U7YtjRcw6G8E7nr5q/QcTjsXtDmK8sx6/XWavU6l/tqGLRbLigL9reIEpZZCA52YrlOl oe/w==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1778091401; cv=none; d=google.com; s=arc-20240605; b=LNd2bzKaIaInjXWiTWnT2TOQvBvtFD89/Gc0tV9wBEkYZXaq0+FE12ObNtKxnmZ4Yv sbvBCSK24Rx/o5YvtyL5Cigyj54/Hre6RoaBMKlDZTmwCHZ93w60jDqg0ndu0u3vPVU4 2pCgxG+Sw7Rl1cadwcQPVlOVn9zyLdXgEEnsZH9KoL9LVHCfkDcn+3wvR6Hn96W2gIUD 4P1tpCu2Wo/auV7dEhafeqhxp/HbIbGi1YOirKTx8EXCalU9qwVBArQg6BINx2fTXypC nQe1OmMDPukM2BqTLmnyvUtKqTu8m3yKFFGyzS0xpbwxh4IP91sPsOhBeLTcQTB5SPv3 zv4A==
- Archived-at: <https://zsh.org/users/30645>
- In-reply-to: <8e1b68fe-1e39-467f-bca1-009b783aa201@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <8b4570a2-bef8-4dea-9052-39a331c5caea@eastlink.ca> <CAN=4vMosgMQUebhXhHfz3YK9=D3_7dtqgYSPSOxGk8Ji1dX6KQ@mail.gmail.com> <8e1b68fe-1e39-467f-bca1-009b783aa201@eastlink.ca>
On Wed, May 6, 2026 at 10:41 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2026-05-06 09:54, Roman Perepelitsa wrote:
> > How do you want to select the 11th item? Which keys do you want to
> > press for that?
> Ha! Good point, never thought of that. But supposing it was a short
> list? One might want the option.
Hm, the documentation, and the code for the "select" loop, suggests
you should be able to examine $ZLE_STATE for the value "select" but I
can't get that ever to be true. Aside to workers, code is:
if (usezle) {
int oef = errflag;
isfirstln = 1;
str = zleentry(ZLE_CMD_READ, &prompt3, NULL,
0, ZLCON_SELECT);
if (errflag)
str = NULL;
/* Keep any user interrupt error status */
errflag = oef | (errflag & ERRFLAG_INT);
but ZLCON_SELECT is never populated in $ZLE_STATE, it always comes back with
"globalhistory insert "
However, this appears to work:
qsel() {
[[ ${(%):-%_} = *select* ]] && zle .accept-line || zle self-insert
}
zle -N qsel
for key in {1..9}; do
bindkey $key qsel
done
Messages sorted by:
Reverse Date,
Date,
Thread,
Author