Skip to content
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

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

Open
39555 opened this issue Oct 13, 2024 · 1 comment · May be fixed by #219
Open

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

39555 opened this issue Oct 13, 2024 · 1 comment · May be fixed by #219

Comments

@39555
Copy link
Contributor

39555 commented Oct 13, 2024

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

  • Why does brush use its own Shell.working_dir instead of the system's std::env::set_current_dir/get_current_dir? It's because a subshell is not a new process?
@reubeno
Copy link
Owner

reubeno commented Oct 13, 2024

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.

@reubeno reubeno changed the title corrent implementation of the physical -P and logical -L directories in cd, pwd and dirs correct implementation of the physical -P and logical -L directories in cd, pwd and dirs Oct 13, 2024
@39555 39555 linked a pull request Oct 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants