Does not work with shwordsplit option (endless loop with path containing space)
zcalusic opened this issue · comments
Check this out:
% mkdir "foo bar baz"
cd foo\ bar\ baz
[ prompt doesn't return... ]
Top reports:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5096 zcalusic 20 0 57284 15988 1600 R 100.0 0.1 0:06.18 zsh
Zsh is stuck in some kind of loop. Ctrl-C helps to get out of it. It happens only if 2 or more spaces are in directory name.
This started happening after I installed zsh-autoenv.
Other than this bug, it's really cool, solves some things very nicely!
Thanks for the feedback!
I cannot reproduce it in some of my autoenv-enabled dirs.
Can you provide steps to reproduce this based on some dir in e.g. /tmp
?
Hello @blueyed!
All there is to it are 2 lines in the beginning of my report. Mkdir & then chdir. Don't forget 2 spaces in the name! Also, .autoenv.zsh
files are not even involved in this experiment.
If you can't reproduce it, then it could be some setting specific to my zsh. Here's the list of my zsh setopts, in case it's relevant:
setopt automenu autolist autocd notify nohup nobgnice nopromptcr noclobber
setopt histignorealldups sharehistory shwordsplit completeinword rmstarsilent
setopt nohistsavebycopy
Zsh version 5.3.1
Can you try setting AUTOENV_DEBUG=3
and then trigger it, please?
[/tmp]% mkdir "foo bar baz"
[/tmp]% cd "foo bar baz"
[autoenv] Calling
[autoenv] chpwd
[autoenv] handler:
[autoenv] PWD=/tmp/foo
[autoenv] bar
[autoenv] baz
[autoenv] Looking
[autoenv] for
[autoenv] env_file:
[autoenv] /tmp/foo
[autoenv] bar
[autoenv] baz/.autoenv.zsh
[ stuck here, 100% CPU, ctrl-C breaks the loop ]
shwordsplit
is the problem - which can already be seen in the debug output (where the lines are split on words).
A fix should be rather easy, will look into it later.
Can confirm it is fixed. Thanks!