Zsh-autosuggestions: "no such file or directory" on ubuntu 20.04 + oh-my-zsh

Created on 9 Aug 2020  路  3Comments  路  Source: zsh-users/zsh-autosuggestions

Describe the bug

After installing zsh-autosuggestions on oh-my-zsh, after reloading zsh I always get:

/home/raul/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh:source:1: no such file or directory: /home/raul/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh^M

To Reproduce

Steps to reproduce the behavior:

  • Clone repo with: git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • Modify my .zshrc file and add the plugin:
plugins=(git zsh-autosuggestions)
  • Reload shell with zsh on the terminal.
  • It outputs:
/home/raul/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh:source:1: no such file or directory: /home/raul/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh^M

Expected behavior

No error message should be displayed and plugin loaded.

Desktop

  • OS + distribution: Ubuntu 20.04
  • Zsh version: 5.8
  • Plugin version: git commit: ae315de
bug

Most helpful comment

Is it possible that you run your ubuntu with wsl on windows? ^M at the error is normally a "git config messed up" sign.

I had the same error and solved it by removing the plugin (in ~/.oh-my-zsh/custom/plugins/zsh-autosuggestion), changing the git CRLF handling:

git config --global core.autocrlf false
git config --global core.eol lf

and re-installing it. Maybe it's working for you too.

All 3 comments

Is it possible that you run your ubuntu with wsl on windows? ^M at the error is normally a "git config messed up" sign.

I had the same error and solved it by removing the plugin (in ~/.oh-my-zsh/custom/plugins/zsh-autosuggestion), changing the git CRLF handling:

git config --global core.autocrlf false
git config --global core.eol lf

and re-installing it. Maybe it's working for you too.

Is it possible that you run your ubuntu with wsl on windows? ^M at the error is normally a "git config messed up" sign.

I had the same error and solved it by removing the plugin (in ~/.oh-my-zsh/custom/plugins/zsh-autosuggestion), changing the git CRLF handling:

git config --global core.autocrlf false
git config --global core.eol lf

and re-installing it. Maybe it's working for you too.

This worked for me,

I changed the config git and re-installing plugins.

Thanks.

I'm not in ubuntu under WSL, but your git configuration totally made it work for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniele-orlando picture daniele-orlando  路  6Comments

NikKovIos picture NikKovIos  路  4Comments

OmeGak picture OmeGak  路  3Comments

dragonxlwang picture dragonxlwang  路  3Comments

srajasimman picture srajasimman  路  5Comments