Interactive and login shell start with root directory as $PWD
by ArchArael from LinuxQuestions.org on (#5EE5Y)
I have recently switched from Manjaro to Fedora and there is one puzzling issue that has been bothering me.
When I login, or start a terminal emulator, the $PWD is always the root (/) directory.
I have checked the /etc/passwd file and the home directory is correct for my user. The permissions are fine as well. If I run cd I go back to the home directory, so $HOME is set. It is just that every new shell starts in / for some reason.
This issue happens both with the login shell and interactive shell. Changing the terminal emulator does not help. Changing the shell does not solve the issue either. I have tried without any .bashrc .profile .zshrc config files, just the default configuration, and the problem is still there.
Right now I have a 'cd $HOME' line in my .zshrc that kind of fixes the issue but has the drawback that I cannot use Ctrl-Shift-N shortcut to start a new terminal instance in the current directory.
If any of you guys had this issue before how did you fix it? I would really like to understand what is the issue.


When I login, or start a terminal emulator, the $PWD is always the root (/) directory.
I have checked the /etc/passwd file and the home directory is correct for my user. The permissions are fine as well. If I run cd I go back to the home directory, so $HOME is set. It is just that every new shell starts in / for some reason.
This issue happens both with the login shell and interactive shell. Changing the terminal emulator does not help. Changing the shell does not solve the issue either. I have tried without any .bashrc .profile .zshrc config files, just the default configuration, and the problem is still there.
Right now I have a 'cd $HOME' line in my .zshrc that kind of fixes the issue but has the drawback that I cannot use Ctrl-Shift-N shortcut to start a new terminal instance in the current directory.
If any of you guys had this issue before how did you fix it? I would really like to understand what is the issue.