Skip to content

Completion Strategy Triggers ^J bound widgets #814

Open
@quicknir

Description

Describe the bug

If anything is bound to ^J, and the completion strategy is active for zsh-autosuggestions, then if you quickly type an auto completion, backspace, type more, backspace, etc, you'll see that whatever ^J is bound to gets called quite often.

To Reproduce

Steps to reproduce the behavior:

Have this in your .zshrc

autoload -Uz compinit
compinit
function blub() { echo hello >> ~/log.txt }
builtin zle -N blub
bindkey -v '^J' blub

. "${ZDOTDIR:h}/zsh-autosuggestions/zsh-autosuggestions.zsh"
export ZSH_AUTOSUGGEST_STRATEGY=(completion)

touch ~/log.txt. Now, if you start typing say cd Do and zsh-autosuggestions suggests "wnloads", I type wn, then backspace, then w, then backspace, etc. Just keep typing some of the suggestion and backspacing without accepting it. After doing this for a bit, you'll see that ~/log.txt has lots of lines of hello in it.

Desktop

  • Ubuntu 22.04.5 LTS (running on WSL)
  • zsh 5.9
  • I tried both 0.7.0 and 0.7.1 and saw the same behavior on both.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions