zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] `menu-complete` bound to `^J` does not cycle the results with `select`
@ 2024-11-01 22:33 NeNikitov
  2024-11-01 22:46 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: NeNikitov @ 2024-11-01 22:33 UTC (permalink / raw)
  To: zsh-workers

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

Hello!

I'd like to report a bug with ^J bind to menu-complete with select option.

Thank you,
Myk
Steps to reproduce

   1. Copy the minimal config to .zshrc
   2. Double check that ^J is only bound to menu-complete

   bindkey | grep '\^J'

   3. Type cd , press CTRL+O multiple times to cycle suggestions - *Completes
   the directory name and cycles to next suggestion, works as expected*
   4. Type cd , press CTRL+J multiple times to cycle suggestions - *Behaves
   exactly as **CTRL+O,** works as expected*
   5. Add select option to completion by running

   zstyle ':completion:*' menu select

   6. Type cd , press CTRL+O multiple times to cycle suggestions - *Still
   cycles, works as expected*
   7. Type cd , press CTRL+J multiple times to cycle suggestions - *Only
   selects the first suggestion, does not cycle, does not work as expected*

Things I tried

   - Different keys - only reproducible with ^J: ^O, ^N and ^I work as
   expected
   - Different binds - happens with menu-complete, complete-word,
   expand-or-complete, menu-expand-or-complete, and reverse-menu-complete
   - Different completion configuration - happens only with select
   - Different OS and terminals - happens both in Nix and Arch with Konsole
   and Alacritty

Minimal config

autoload -U compinit

zstyle ':completion:*' menu

bindkey '^J' menu-complete
bindkey '^O' menu-complete

compinit

[-- Attachment #2: Type: text/html, Size: 3948 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] `menu-complete` bound to `^J` does not cycle the results with `select`
  2024-11-01 22:33 [BUG] `menu-complete` bound to `^J` does not cycle the results with `select` NeNikitov
@ 2024-11-01 22:46 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2024-11-01 22:46 UTC (permalink / raw)
  To: NeNikitov; +Cc: zsh-workers

On Fri, Nov 1, 2024 at 3:33 PM NeNikitov <nenikitov@gmail.com> wrote:
>
> I'd like to report a bug with ^J bind to menu-complete with select option.

Menu selection has its own keymap ("menuselect"), you have to rebind
^J in that keymap as well.  There's an example of this for ^M at the
end of the manual section on the complist module.  ^O is unaffected
because it's not (by default) bound in the menuselect map so it falls
through to the behavior in the main keymap.

bindkey -M menuselect ^J undefined-key # to fall through to main keymap


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-01 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-01 22:33 [BUG] `menu-complete` bound to `^J` does not cycle the results with `select` NeNikitov
2024-11-01 22:46 ` Bart Schaefer

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