Tarrasch / zsh-autoenv

Autoenv for zsh
694 stars 30 forks source link

Error if path contains spaces #39

Closed jfsantos closed 6 years ago

jfsantos commented 8 years ago

I am using zsh-autoenv on OS X and it breaks if the path where the .autoenv.zsh file is saved contains spaces. The error message is the following:

cd ~/test\ folder
_autoenv_authorized_env_file:local:2: not valid in this context: folder/.autoenv.zsh:423624aee303faed668094684c5156df46d491a2:1

I tried adding quotes around $1 in the _autoenv_autorized_env_file definition in autoenv.zsh, but it does not make any difference. I also tried using ${(q)env_file} instead of $env_file when calling _autoenv_hash_pair, but then it complains about a missing file argument for the function.

blueyed commented 8 years ago

I tried adding quotes

The error is in the 2nd line. Try: local pair="$(_autoenv_hash_pair $env_file)"

Which Zsh version are you using? What is the output of setopt? (looks similar to #38)

jfsantos commented 8 years ago

I'm running Zsh 5.0.8, and I don't have the shwordsplit option enabled, but adding quotes to the second line worked.