Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

`pwd -P` with systemd-homed causes inconsistent cwd state



I have found a strange behavior with ZSH when working with systemd-homed. After running `pwd -P` within my home directory, it seems as if the current working directory effectively changes to `/`. I am currently using ZSH 5.9 and systemd 254.

systemd-homed is configured using a BTRFS subvolume. My home directory is `/home/kyle` whereas the systemd-homed image is located at `/home/kyle.homedir`. Running `pwd -P` prints the current directory under the homed image path which isn't entirely unexpected (though this behavior differs from that of other shells such as bash and fish which still print `/home/kyle/...`). What is unexpected is that after running `pwd -P` all other subprocesses act as if the `cwd` is `/` (though the `pwd` builtin and `$PWD` env var do not show any chagne).

To summarize what I am seeing:

```
% ls
test.txt
% pwd
/home/kyle/test
% pwd -P
/home/kyle.homedir/test
% ls
bin boot dev etc home lib lib64 mnt opt proc root run sbin srv sys tmp usr var
% pwd
/home/kyle/test
% /bin/pwd
/
% zsh -c "pwd"
/
% cd .
% ls
test.txt
% /bin/pwd
/home/kyle/test
% pwd
/home/kyle/test
```

Is there a configuration change that I need to make for ZSH or for systemd-homed to not end up with an inconsistent cwd state after running the `pwd` command?




Messages sorted by: Reverse Date, Date, Thread, Author