zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.57k stars 1.88k forks source link

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

Open rahulr8 opened 3 years ago

rahulr8 commented 3 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 3 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.

mengxi-ream commented 1 year ago

same problem here

mengxi-ream commented 1 year ago

same problem here

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

imran-khani commented 7 months ago

source zsh-autosuggestions/zsh-autosuggestions.zsh

Thank you it work for me.

prkhrv commented 5 months ago

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

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
vibhum15 commented 2 months ago

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

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

It is working for one session only when you restart again it stops working