zsh-autocomplete: History menu doesn't insert completion when part of the word is typed (Oh-My-Zsh)

Environment

  • Zsh version: 5.5.1
  • zsh-autocomplete version: 0da3bdc1dd7c97a6afba53e922483a8be70acb4d
  • Latest Oh-My-Zsh (manually updated using omz update today, 16 Oct 2020)

Please report if the bug occurs without config files:

$ cd $(mktemp -d)  # Create a temp dir and enter it.
$ ZDOTDIR=$PWD HOME=$PWD zsh -f  # Start a subshell in it without config files.
% source path/to/zsh-autocomplete.plugin.zsh  # Source the plugin.
% # Try to reproduce your bug...

Does the bug occur without config files?

  • Yes

  • No

If not, gradually add lines from your config file to the subshell until the bug appears.

Which combination of config causes the bug to appear?

source /root/.oh-my-zsh/oh-my-zsh.sh
source /root/.oh-my-zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh

Steps to reproduce

  1. Let’s say I want to type nano .zshrc which I’ve entered before so it’s going to appear in history menu
  2. I typed na and pressed arrow up
  3. Select nano .zshrc and enter

Expected behavior

It should be saying nano .zshrc in my terminal

Actual behavior

It goes back to na If there’s nothing in the terminal (me without typing na), it actually works.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 31 (15 by maintainers)

Commits related to this issue

Most upvoted comments

After creating a temp ZSH shell and just sourcing the completion.zsh and zsh-autocompelete, the first command as well as the second command after the first commands work perfectly.

@marlonrichert deleting completion.zsh in .oh-my-zsh/lib fixed it apparently.

Can you try the following?

  1. Make a backup of .oh-my-zsh/lib.
  2. For each file in .oh-my-zsh/lib:
    1. Delete the file.
    2. Run a clean subshell with OMZ and zsh-autocomplete, as described above.
    3. See if the problem occurs.

Does deleting any of these files cause the problem to go away? If so, which one?

We should thank you for your time on this, very grateful about it much thanks.

Alright, it’s fixed now. Thanks for helping out!

Hi, I’m suffering from the same problem.

I copy .oh-my-zsh/lib/completion.zsh to a file try, comment some of the lines and run the following:

$ zsh -f
% source /path/to/try
% source /path/to/zsh-autocomplete.plugin.zsh

If line 1-13 are left uncommented, the completion goes well. But if I uncomment line 14 further, the problem occurs, so I think it is the line 14 that causes the problem, which says

zstyle ':completion:*:*:*:*:*' menu select

Great! That narrows it down a lot. I’ll see what I can do fix it.

@marlonrichert I’ve actually given up on oh-my-zsh as I found it’s undocumented “helpers” were more of a hindrance! I am not seeing this behaviour (I’m still on d7e7b05).