zsh-autocomplete icon indicating copy to clipboard operation
zsh-autocomplete copied to clipboard

Widget not working properly after update `96bbb5b` with oh-my-zsh

Open latipun7 opened this issue 1 year ago β€’ 5 comments

  • [x] I have carefully read all of the instructions in this issue template.
  • [x] I have carried them out to the letter.

Failure to do so can and will result in your issue being closed without warning.

Environment

❯ print $VENDOR $OSTYPE $SHELL $ZSH_ARGZERO $ZSH_PATCHLEVEL
unknown linux-gnu /usr/bin/zsh -zsh zsh-5.9-0-g73d3173
❯ print -l $_autocomplete__funcfiletrace
/home/latipun/.zshrc:102
❯ git -C ~zsh-autocomplete log --oneline -n1
4c363ff - (HEAD -> main, origin/main, origin/HEAD) Let `^_` exit menu and remove last completion
  • Operating system: Arch Linux
  • Terminal emulator: Windows Terminal via SSH
  • [x] I have filled out the fields above.
  • [x] I have ran the commands in the code block above.
  • [x] I have pasted their output into the same block.

Steps to reproduce

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
# here the autocomplete is normal, no unusual behavior

exit # to previous temp directory
git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git
mkdir -p .local/share
mv ohmyzsh .local/share/oh-my-zsh
mv zsh-autocomplete .local/share/oh-my-zsh/custom/plugins
rm -f .zshrc
> .zshrc <<EOF
export ZSH="$PWD/.local/share/oh-my-zsh"
plugins=(zsh-autocomplete)
source $ZSH/oh-my-zsh.sh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
# here, zsh-autocomplete has weird behavior, description below
  • [x] I have run the code block above to create a test environment.
  • [x] I have reproduced my problem in this environment in the most minimal way possible.
  • [x] I have copy-pasted my entire test session into the same code block.

When I use this plugin in this commit: https://github.com/marlonrichert/zsh-autocomplete/commit/d8bfbef46efc54c1189010a3b70d501b44487504, zsh-autocomplete is works normal. After I update to this https://github.com/marlonrichert/zsh-autocomplete/commit/4c363ff553be227db90842d7481fd6e02de8703c, this plugin now behaves weird. No error messages are displayed. The plugin fails to display the full widget, populating it only with an arbitrary subset of completions. Curiously, pressing tab flashes the widget for a split-second.

This behavior is reproducible when I set minimal OMZ. I'm on this https://github.com/ohmyzsh/ohmyzsh/commit/3668ec2a82250020ca0c285ef8b277f1385a8085. Moved this plugin into OMZ custom plugin directory. Then updated .zshrc to this:

export ZSH="/tmp/tmp.XXXXXXXXXX/.local/share/oh-my-zsh"
plugins=(zsh-autocomplete)
source $ZSH/oh-my-zsh.sh

Here is the video

https://user-images.githubusercontent.com/20012970/185736155-836555bb-c004-4e98-b514-d57194d3c49c.mp4

latipun7 avatar Aug 20 '22 08:08 latipun7

Experiencing the same problem. Sticking to d8bfbef46efc54c1189010a3b70d501b44487504 as temporary work around.

koseduhemak avatar Aug 20 '22 12:08 koseduhemak

@latipun7 @koseduhemak Can you please reduce the test case to the minimum needed to reproduce the problem? Thanks!

marlonrichert avatar Aug 21 '22 12:08 marlonrichert

Hi @marlonrichert , thank you for your attention. For the test environment provided, it should be already clean, right? Then I don't think I can provide more minimal example than what I describe.

In clean environment, I just clone https://github.com/ohmyzsh/ohmyzsh then clone this plugin into OMZ custom directory. Then in .zshrc, I just configured to source OMZ with only this plugin as shown below:

export ZSH="/tmp/tmp.XXXXXXXXXX/.local/share/oh-my-zsh"
plugins=(zsh-autocomplete)
source $ZSH/oh-my-zsh.sh

Then run ZSH with that ,zshrc: env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d

For reference, I think this file is what OMZ do for completion: https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/completion.zsh

I think that file is sourced after this plugin. Thank you. Sorry, I'm just user with ZSH, didn't know how to make this more minimal πŸ™

Also, I've updated my entire test session in step to reproduce.

latipun7 avatar Aug 21 '22 22:08 latipun7

After I update to this https://github.com/marlonrichert/zsh-autocomplete/commit/4c363ff553be227db90842d7481fd6e02de8703c, this plugin now behaves weird.

It’s quite impossible for that to be the faulty commit. The problem more likely lies in 96bbb5bb5b3698ca23d54ee28eb595a3727bf6df.

marlonrichert avatar Aug 22 '22 05:08 marlonrichert

Yes. The update causing this behavior is this https://github.com/marlonrichert/zsh-autocomplete/commit/96bbb5bb5b3698ca23d54ee28eb595a3727bf6df commit.

latipun7 avatar Aug 22 '22 07:08 latipun7

I'm closing this since this is duplicate of #483. My Issue is the same exact issue of that, which is "flickering" widget when pressing Tab & widget not showing when this plugin is combined by oh-my-zsh

latipun7 avatar Oct 14 '22 00:10 latipun7