-
Notifications
You must be signed in to change notification settings - Fork 146
Description
What happened?
When setting up zinit in a home directory in an NFS server, that is mounted in different machines in different directories then symlinked to /home, the links in the completions directory will be broken, because they will be absolute and resolved to real paths:
For example:
$ ls ~/.local/share/zinit/completions | grep _scala
lrwxrwxrwx 1 dmiranda users 118 Nov 1 06:41 _scala -> /mnt/long_meaningless_path/user/home/dmiranda/.local/share/zinit/plugins/zsh-users---zsh-completions/src/_scalaThis breaks when I log into a different machine using the same home directory, but that has it mounted somewhere else. As a user, it should be invisible to me, as my home dir is always correctly linked to /home/dmiranda, but the symlinks being made absolute and real breaks it completions when I move between machines.
If they were linked just as /home/dmiranda/... things would still work as expected.
I see here we list the completions files explicitly as absolute real paths:
Line 563 in 0c471af
| for c in "${completions[@]:A}"; do |
I believe the links should be made relative if possible, or at the least, make it an option to not realise paths, so they at become links to /home/dmiranda (or whatever is in ZINIT[HOME_DIR], ZINIT[PLUGINS_DIR], etc).
Steps to reproduce
- Create a directory anywhere in your system, example
/mnt/test_user. - Symlink
/home/test_userto/mnt/test_user - Install plugins with zinit as
test_user. The completions directory will have symlinks pointing to/mnt/test_user. - Rename
/mnt/test_user, update/home/test_usersymlink. - Try to use
zinitagain, completions will be missing due to broken symlinks.
Relevant output
No response
Screenshots and recordings
No response
Operating System & Version
OS: linux-gnu | Vendor: debian | Machine: x86_64 | CPU: x86_64 | Processor: unknown | Hardware: x86_64
Zsh version
zsh 5.8 (x86_64-debian-linux-gnu)
Terminal emulator
irrelevant (iTerm2)
If using WSL on Windows, which version of WSL
None
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct