Repository: marlonrichert/zsh-autocomplete

Issue #441: Autosuggestion stops functioning with zsh 5.9 after a few directory changes
Created: 2022-05-31T21:43:15Z
doesn't seem to happen with zsh 5.8
Environment

apple darwin21.3.0 /bin/zsh /opt/local/bin/zsh zsh-5.9-0-g73d3173

/Users/ray.janoka/.zsh-snap/functions/.znap.source:26
/Users/ray.janoka/.zsh-snap/functions/znap:42
.zsh.d/zsnap.zsh:2
/Users/ray.janoka/.zshrc:134

5b0073d (grafted, HEAD -> main, origin/main, origin/HEAD) Check that `$ZSH_COMPDUMP` file can be read

Operating system: macOS
Terminal emulator: iTerm

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} /opt/local/bin/zsh -d
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 59 (delta 0), reused 27 (delta 0), pack-reused 0
Receiving objects: 100% (59/59), 1.64 MiB | 5.47 MiB/s, done.
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd ..
% cd zsh-autocomplete
% cd 

there will be no suggestion for the final cd

Duplicate issue #463: .autocomplete.recent_paths.add:shift:16: shift count must be <= $#
Created: 2022-08-06T07:21:29Z
I have carefully read all of the instructions in this issue template.
 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
print -l $_autocomplete__funcfiletrace
git -C ~zsh-autocomplete log --oneline -n1

ubuntu linux-gnu /usr/bin/zsh /usr/bin/zsh ubuntu/5.8-3ubuntu1.1
/home/ismail/.zshrc:1
d8bfbef (grafted, HEAD -> main, origin/main, origin/HEAD) Improve `ignored-input` documentation

Zorin OS 16
Terminal emulator: Alacritty


 I have filled out the fields above.
 I have ran the commands in the code block above.
 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

 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.

Terminal close abruptly. I could not reproduce it. But in log files in $HOME/.local/share/zsh-autocomplete/log the error is:
.autocomplete.recent_paths.add:shift:16: shift count must be <= $#
.autocomplete.recent_paths.add:shift:16: shift count must be <= $#
.autocomplete.recent_paths.add:shift:16: shift count must be <= $#
.autocomplete.recent_paths.add:shift:16: shift count must be <= $#

I did a little research.
https://stackoverflow.com/questions/71567420/how-to-handle-error-shift-count-must-be-in-zsh
I think a little check in _autocomplete.recent_paths will be enough.

Closing comment (2022-08-06T12:23:24Z): Duplicate of #441.