zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.32k stars 1.85k forks source link

Zsh-autocomplete not working once I close terminal or start a new session #632

Open rahulr8 opened 2 years ago

rahulr8 commented 2 years ago

Describe the bug

Zsh-autocomplete works great for me in any given zsh session. But as soon as I open a new session (new terminal tab or restart terminal), none of my previous commands are available for me to auto-complete.

Machine - Mac M1

I installed using: git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions and in my .zshrc I have:

plugins=(zsh-autosuggestions)

source $ZSH/oh-my-zsh.sh

I've looked for the fix everywhere but noone seems to be having similar issues.

ericfreese commented 2 years ago

Have you seen the comments on #416?

AlanDecode commented 1 year ago

Same problem here. I'm not using oh-my-zsh though, just source zsh-autosuggestions/zsh-autosuggestions.zsh in ~/.zshrc.

lhuangufl commented 1 year ago

You need to add these two zsh file to your ~/.zshrc

source /PATH/TO/zsh-autosuggestions/zsh-autosuggestions.zsh source /PATH/TO/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

AlanDecode commented 1 year ago

Same problem here. I'm not using oh-my-zsh though, just source zsh-autosuggestions/zsh-autosuggestions.zsh in ~/.zshrc.

For me, it is because the history file not set properly for zsh commands. Problem solved.

Crayon-ShinChan commented 9 months ago

same problem here

Crayon-ShinChan commented 9 months ago

same problem here

nvm, I didn't add source zsh-autosuggestions/zsh-autosuggestions.zsh in end of ~/.zshrc file

imran-khani commented 2 months ago

source zsh-autosuggestions/zsh-autosuggestions.zsh

Thank you it work for me.

prkhrv commented 3 weeks ago

For any one looking for a Solution adding this to ~/.zshrc worked for me

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh