Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with shwordsplit option (endless loop with path containing space) #75

Closed
zcalusic opened this issue Nov 1, 2017 · 6 comments
Labels

Comments

@zcalusic
Copy link

zcalusic commented Nov 1, 2017

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!

@blueyed
Copy link
Collaborator

blueyed commented Nov 2, 2017

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 ?

@zcalusic
Copy link
Author

zcalusic commented Nov 2, 2017

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

@blueyed
Copy link
Collaborator

blueyed commented Dec 13, 2017

Can you try setting AUTOENV_DEBUG=3 and then trigger it, please?

@zcalusic
Copy link
Author

[/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 ]

@blueyed
Copy link
Collaborator

blueyed commented Dec 15, 2017

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.

@blueyed blueyed added bug and removed needs info labels Dec 15, 2017
@blueyed blueyed changed the title Zsh lockup when chdir folder with 2 or more spaces in the name Does not work with shwordsplit option (endless loop with path containing space) Dec 15, 2017
blueyed added a commit to blueyed/zsh-autoenv that referenced this issue Dec 15, 2017
Add `shwordsplit` option.

Ref: Tarrasch#75
blueyed added a commit to blueyed/zsh-autoenv that referenced this issue Dec 15, 2017
Add `shwordsplit` option.

Ref: Tarrasch#75
blueyed added a commit to blueyed/zsh-autoenv that referenced this issue Dec 16, 2017
This uses `emulate -L zsh` (as a more broad approach to `setopt
localtoptions noshwordsplit`, or quoting things) in the entry points to
zsh-autoenv.

Fixes Tarrasch#75
blueyed added a commit that referenced this issue Dec 16, 2017
This uses `emulate -L zsh` (as a more broad approach to `setopt
localtoptions noshwordsplit`, or quoting things) in the entry points to
zsh-autoenv.

Fixes #75
@zcalusic
Copy link
Author

Can confirm it is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants