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

zsh-config: zshrc hangs if OLDPWD is no longer available #51

Closed
morxa opened this issue Jun 25, 2015 · 2 comments
Closed

zsh-config: zshrc hangs if OLDPWD is no longer available #51

morxa opened this issue Jun 25, 2015 · 2 comments

Comments

@morxa
Copy link

morxa commented Jun 25, 2015

I have a systemd automount, which is an external USB drive and thus not always available. If I have switched to the mount point recently and it is listed in .zdirs, but currently the drive is not available, zsh hangs while loading /etc/zsh/zshrc.

I assume this should also work with any other directories which are not available anymore.

How to reproduce

  1. Create an automount for /mnt/usb
  2. cd /mnt/usb
  3. Close the terminal
  4. Umount /mnt/usb and unplug the device
  5. Start a new terminal and load the profile from /etc/zsh/zshrc

Expected behavior

The script should detect that /mnt/usb is no longer available and skip calling cd /mnt/usb.

Actual behavior

In line 1625 of the profile file, cd /mnt/usb is called. The call hangs because the device is longer available. Even after the automount times out, the terminal still doesn't finish loading the profile.

@ft
Copy link
Member

ft commented Jun 26, 2015

The problem isn't OLDPWD but $dirstack[1] AFAICT.

I have just pushed ef0f249 — which should deal with the problem.

Thanks for reporting and let us know if this fixes your issue!

@morxa
Copy link
Author

morxa commented Jul 9, 2015

Thanks, that fixed it!

@morxa morxa closed this as completed Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants