reubeno / brush

bash/POSIX-compatible shell implemented in Rust
MIT License
27 stars 4 forks source link

correct implementation of the `physical -P` and `logical -L` directories in `cd`, `pwd` and `dirs` #202

Open 39555 opened 1 month ago

39555 commented 1 month ago

I've started working on correctly handling symlinked paths and have some questions about cwd implementation details.

reubeno commented 1 month ago

It's because a subshell is not a new process?

Yes, that's the main reason. It's been a source of friction along the way, but in practice, actual interactions with the filesystem have been relatively limited to I/O redirection, the source builtin, cd/pushd/popd, and a few other places.

If you look for everywhere the shell object can get cloned--and there's more places than would be ideal--you'll see where we leverage this.