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

cd /soft/link/directory/from/other/mount/point end up in Infinite Loop #133

Closed
ashokrajar opened this issue Aug 26, 2016 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@ashokrajar
Copy link
Contributor

Need support for symlinked directory too. When you try to switch into a soft linked directory from other mount point it ends in an infinite loop and the terminal hangs until pressing ctrl + C.

eg:
OS : Mac OSX
autoenv : 1.0.0
Shell : zsh

ln -s /Volumes/Disk1/code /Users/ashokraja/code
cd /Users/ashokraja/code/autoenv


df /Users/ashokraja/code
++ awk 'END{print $NF}'
++ _mountpoint=/Volumes/MDRIVE
++ _hadone=
++ '[' /Users/ashokraja/code '!=' /Volumes/Disk1 ']'
++ _file=/Users/ashokraja/code/.env
++ '[' -f /Users/ashokraja/code/.env ']'
++ command -v chdir
++ builtin cd ..
++ '[' /Users/ashokraja '!=' /Volumes/Disk1 ']'
++ _file=/Users/ashokraja/.env
++ '[' -f /Users/ashokraja/.env ']'
++ command -v chdir
++ builtin cd ..
++ '[' /Users '!=' /Volumes/Disk1 ']'
++ _file=/Users/.env
++ '[' -f /Users/.env ']'
++ command -v chdir
++ builtin cd ..
++ '[' / '!=' /Volumes/Disk1 ']'
++ _file=//.env
++ '[' -f //.env ']'
++ command -v chdir
++ builtin cd ..
++ '[' / '!=' /Volumes/MDRIVE ']'
++ _file=//.env
++ '[' -f //.env ']'
++ command -v chdir
++ builtin cd ..
...
....

Infinite loop.

@dasJ dasJ added the type/bug label Aug 29, 2016
@dasJ
Copy link
Contributor

dasJ commented Aug 29, 2016

This is really hard to solve. On linux, I can use readlink -f to canonicalize every symlink, but this option does not exist on darwin. Do you have any idea how to do this on darwin? As I don't have a Mac, I can not test this myself 👎

@ashokrajar
Copy link
Contributor Author

How about using pwd -P command ?

@dasJ
Copy link
Contributor

dasJ commented Aug 29, 2016

@ashokrajar Does this work on darwin as well?

@ashokrajar
Copy link
Contributor Author

Yup it works on darwin too. I have verified.

@dasJ
Copy link
Contributor

dasJ commented Aug 29, 2016

Can you test #135 please?

@dasJ dasJ added this to the 0.2.1 milestone Aug 29, 2016
@dasJ dasJ self-assigned this Aug 29, 2016
@dasJ dasJ closed this as completed in #136 Sep 8, 2016
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