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

Menu items not showing on Ubuntu 22.04 - Terminator - OMZ

Open TheProjectsGuy opened this issue 1 year ago • 3 comments

When I try using the suggestions, they do not appear at the bottom of the prompt. I always have to use the down arrow to bring them up. They seem to flicker when I press the tab key (unless there is only one obvious choice). This used to work in Ubuntu 20.04 with the same Agnoster theme.

  • [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 -l $_autocomplete__funcfiletrace
git -C ~zsh-autocomplete log --oneline -n1
$ print $VENDOR $OSTYPE $SHELL $ZSH_ARGZERO $ZSH_PATCHLEVEL
ubuntu linux-gnu /usr/bin/zsh /usr/bin/zsh ubuntu/5.8.1-1

$ print -l $_autocomplete__funcfiletrace
/home/avneesh/.zshrc:82

$ git -C ~zsh-autocomplete log --oneline -n1
aed8e17 (HEAD -> main, origin/main, origin/HEAD) Fix recent-dirs naming conflict
  • Operating system: Linux Mint 21 (Vanessa), downstream of Ubuntu 22.04 (Jammy) and Debian bookworm
  • Terminal emulator: Terminator (version 2.1.1), ZSH, Agnoster theme
  • [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
  • [x] I have run the code block above to create a test environment.
  • [ ] I have reproduced my problem in this environment in the most minimal way possible.
  • [ ] I have copy-pasted my entire test session into the same code block.

Somehow, in the above steps, the issue does not occur.

The problem is not getting options here image

In the above test session, they do come up image

TheProjectsGuy avatar Sep 13 '22 07:09 TheProjectsGuy

By "flickering" options, I mean the menu flickers when I press the tab key. When it stayed earlier, it served as an important visual guide for me and I really want it to be there.

https://user-images.githubusercontent.com/29420733/189837531-d6512599-cde5-4ca6-a24a-1a2c3d880208.mp4

TheProjectsGuy avatar Sep 13 '22 07:09 TheProjectsGuy

Getting the same issue in Ubuntu 18.04, manual installation, default settings.

My other computer is on 5b0073d and working, so I checked it out manually and the problem is no more.

Probably a recent commit somewhere.

Ynng avatar Sep 14 '22 14:09 Ynng

I'm unable to reproduce this in a clean environment like this on Ubuntu 20.04 with Zsh 5.8:

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

Can you please use the setup above to create a minimal, reproducible test case? If I cannot reproduce the bug, then I cannot fix it.

marlonrichert avatar Sep 19 '22 06:09 marlonrichert

Can you please use the setup above to create a minimal, reproducible test case? If I cannot reproduce the bug, then I cannot fix it.

image

I am unable to get the same behavior in a minimal environment. Is there any other way (maybe I could send some files)?

However, this issue is not happening on 5b0073d as suggested by @Ynng.

TheProjectsGuy avatar Sep 20 '22 05:09 TheProjectsGuy

I am unable to get the same behavior in a minimal environment.

@TheProjectsGuy This means the problem is somewhere else in your dotfiles. Please add parts of your Zsh dotfiles to the minimal env until you find what causes this.

My other computer is on 5b0073d8ffde20498c820f94ddc62b7f3f54cfc7 and working, so I checked it out manually and the problem is no more.

@TheProjectsGuy @Ynng Can you please run git bisect in the zsh-autocomplete repo in the environment where the bug occurs to find the exact commit where the bug appears for you?

marlonrichert avatar Sep 20 '22 10:09 marlonrichert

d8bfbef4 is the last working commit for me, so 96bbb5bb broke it for me.

I've done a bit of testing and found that the problem only occurs with zsh-autocomplete + ohmyzsh + powerlevel10k

Here's a test case:

  1. Setup Ubuntu 22.04 LTS (I did it in wsl)
  2. Install zsh, chose option 2 to populate .zshrc
  3. git clone https://github.com/marlonrichert/zsh-autocomplete to ~
  4. Install oh my zsh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  5. add skip_global_compinit=1 to .zshenv
  6. append the following to .zshrc
setopt autocd extendedglob nomatch notify
zstyle :compinstall filename '$HOME/.zshrc'
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
  1. Install powerline 10k: git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  2. Start a new zsh instance to go through powerline 10k's configuration wizard. Always pick the first option
  3. ~~Set `ZSH_THEME="powerlevel10k/powerlevel10k" in .zshrc~~ (not needed)
  4. cd ~
  5. Press tab

Ynng avatar Sep 21 '22 03:09 Ynng

d8bfbef4 is the last working commit for me, so 96bbb5bb broke it for me.

Thanks! That explains it completely. Fixing it should be trivial.

marlonrichert avatar Sep 21 '22 06:09 marlonrichert

By testing a few commits i found out that specifically f4e6b33 is when this behavior starts appearing

Locorock avatar Sep 21 '22 12:09 Locorock

@Locorock Did you run git bisect? Changing the commit that @Ynng pointed out fixes it for me. Also, did you test in the same environment as @Ynng? Or what is your test setup?

marlonrichert avatar Sep 21 '22 13:09 marlonrichert

@marlonrichert Not really, i just did it manually. This is the only content of my .zshrc

source ~/.plugins/zsh-snap/znap.zsh
znap source marlonrichert/zsh-autocomplete
znap source ohmyzsh/ohmyzsh

I'm running this on Arch with Linux 5.19.9

Locorock avatar Sep 21 '22 13:09 Locorock

@Locorock Modifying the change in 96bbb5bb5b3698ca23d54ee28eb595a3727bf6df fixed your test case for me. So, it's not possible that the commit you pointed out is the faulty one.

marlonrichert avatar Sep 22 '22 06:09 marlonrichert

@marlonrichert You are correct, somehow i ended up making a shallow clone of the repository and 96bbb got cut out, i can confirm that the commit before 96bbb5b works correctly

Locorock avatar Sep 22 '22 07:09 Locorock

@TheProjectsGuy @Ynng Can you please run git bisect in the zsh-autocomplete repo in the environment where the bug occurs to find the exact commit where the bug appears for you?

I ran the following git bisect session on the package. Just as with @Ynng and @Locorock, it appears that commit 96bbb5bb5b3698ca23d54ee28eb595a3727bf6df does not work correctly, but commit d8bfbef46efc54c1189010a3b70d501b44487504 (commit immediately before 96bbb5bb5b3698ca23d54ee28eb595a3727bf6df) works perfectly.

image

A simple git diff says that not much has changed.

image

TheProjectsGuy avatar Oct 03 '22 07:10 TheProjectsGuy

Thanks, but as I said, I already found a fix:

Modifying the change in https://github.com/marlonrichert/zsh-autocomplete/commit/96bbb5bb5b3698ca23d54ee28eb595a3727bf6df fixed your test case for me.

marlonrichert avatar Oct 03 '22 07:10 marlonrichert

>>> ls
same-prefix-folder-a    same-prefix-folder-b    diff-prefix-folder
>>> cd diff    // match one folder will show suggestion
directory
diff-prefix-folder
>>> cd same    // match more than on folder, will not show suggestion

chaoqunya avatar Oct 12 '22 05:10 chaoqunya

Having the same issue. Someone suggested a particular commit for me to try (d8bfbef as others have pointed out) and that does fix the issue temporarily. However, after running perhaps 3-4 commands, it completely breaks and I get no autocompletion at all.

Am I to take it that the comment by marlonrichert 2 above this one means the issue has been spotted and/or fixed? I don't see any commit since Sep 9. I would be willing to provide any info/help I can.

EDIT: Running the current HEAD leads to the same behaviour as before -- if I type ls and hit tab, I get a brief flash of the directory on screen and then it vanishes. There seems to be conflicting info and reports in this thread so I'm not sure what to try.

MrAureliusR avatar Oct 13 '22 23:10 MrAureliusR

@MrAureliusR if you have installed manually try to revert to the commit mentioned: git checkout d8bfbef46efc54c1189010a3b70d501b44487504 => this requires to clone the repo without --depth 1 this fixed it for me if not you will have to wait for the fix someone correct me if i'm wrong

sevy2011 avatar Oct 14 '22 00:10 sevy2011

Thanks, but as I said, I already found a fix:

Modifying the change in 96bbb5b fixed your test case for me.

@marlonrichert , please push the fix 🙏

latipun7 avatar Oct 14 '22 00:10 latipun7

Sorry for the delay. I haven’t had much time for plugin development lately because of programming-related injuries. I’ll make a Pull Request soon for you to review.

marlonrichert avatar Oct 14 '22 13:10 marlonrichert

@MrAureliusR if you have installed manually try to revert to the commit mentioned: git checkout d8bfbef46efc54c1189010a3b70d501b44487504 => this requires to clone the repo without --depth 1 this fixed it for me if not you will have to wait for the fix someone correct me if i'm wrong

Please read my entire comment. I already tried that commit, and it only partially fixes the issue.

MrAureliusR avatar Oct 14 '22 13:10 MrAureliusR

Please try the branch in the pull request above and let me know if it works for you.

marlonrichert avatar Oct 14 '22 14:10 marlonrichert