-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Using su
can cause $XDG_*
vars to get set to subfolders of /root
, which messes up Znap initialization
#183
Comments
Looks like, when you do
and when using |
Can you try doing |
It does solve the problem, it doesn't try to write to /root/, but then znap + auto-complete and auto-suggestions is not loaded. |
Does it give any error messages? |
No. It only shows the default Also, just to add, if I comment out |
Before doing |
Ok, so I don't understand why The log i got after doing The log I got after I ran Hope this helps |
Your zsh-autocomplete.log is 0 KB. Did your upload fail somehow? |
What happens if, instead of using |
Now it uploaded correctly zsh-autocomplete.log, I did
If I do |
Can you comment out most of the things in your |
I commented out everything and did the test 4 times: no-autocomplete with set -vx after sourcing znap.zsh |
What is "XDG_CACHE_HOME", "XDG_CONFIG_HOME" and "XDG_DATA_HOME" used for? I added export XDG_CACHE_HOME=$HOME/.cache export XDG_CONFIG_HOME=$HOME/.config export XDG_DATA_HOME=~/.local/share At the beginning of my .zshrc and no errors or infinite loops occur |
OK, thanks. That’s a good clue. In your print -lr "${(q+)HOME}" "${(q+)XDG_CACHE_HOME}" "${(q+)XDG_CONFIG_HOME}" "${(q+)XDG_DATA_HOME}" and share the output here? |
/home/phlm '' '' '' ~ $ sudo su [sudo] password for phlm: ~ # su phlm /home/phlm /root/.cache /root/.config /root/.local/share |
OK, so, for some reason, when you expand your user's privileges with Can you check the following files and see if they get set somewhere in there? /etc/zshenv
/etc/zprofile
/etc/zshrc
/etc/zlogin
/etc/zlogout |
$XDG_*
vars get set to subfolders of /root
when using su
$XDG_*
vars get set to subfolders of /root
when using su
su
can cause $XDG_*
vars to get set to subfolders of /root
, which messes up Znap initialization
Zsh has its own
all of the files insite |
What needs to be done is
Pull requests welcome. 🙂 |
Describe the bug
I just started using znap, followed the basic dotfiles usage for my (phlm) and root users, but when I
$ sudo su
then# su phlm
, some "zf_mkdir" errors appear, followed by an infinite autocomplete loopSteps To Reproduce
Expected behavior
Normal switch between root user and my user with
sudo su
andsu <my user>
Observed behavior
Currently, when I
su <my user>
after doingsudo su
, apparently my shell is trying tomkdir /root/.local
(even though I just switched to my non-root user with su), see log belowClick to expand
Environment:
Additional context
I used Oh My Zsh previously and it was working fine with only zsh-autocomplete, zsh-autosuggestions and zsh-syntax-highlighting, I wanted to change to zsnap for being light-weight.
I'll include my zshrc, but I changed it multiple times, still the same result...
My .zshrc
The text was updated successfully, but these errors were encountered: