-
Notifications
You must be signed in to change notification settings - Fork 221
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
cmd: Jump to /run/host/$PWD when entering toolbox #1205
base: main
Are you sure you want to change the base?
Conversation
Build failed. ✔️ unit-test SUCCESS in 8m 55s |
As a convenience to users, when entering a container toolbx tries to maintain the working directory from the host. This works great if the user is inside their home directory, for instance, since the home directory is shared between host and container. It can be confusing in other cases, though. The issue is that the directory in the container may have the same path as the directory in the host, but have completely different contents. The old contents may actually be in /run/host/$PWD instead. Switching to /run/host/$PWD unconditionally has its own downsides. For one, it's ugly, and also, in common cases, like subdirectories of the home directory, it's unnecessary. This commit tries to find the balance, by making toolbx check first if the directory is shared between host and container, and if not, only then falling back to trying /run/host/$PWD. Closes containers#988
a9e1f14
to
c39f684
Compare
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
c39f684
to
71a586b
Compare
Build succeeded. ✔️ unit-test SUCCESS in 8m 35s |
71a586b
to
82c4b2e
Compare
Build succeeded. ✔️ unit-test SUCCESS in 8m 35s |
82c4b2e
to
c39f684
Compare
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
As a convenience to users, when entering a container toolbx tries to maintain the working directory from the host. This works great if the user is inside their home directory, for instance, since the home directory is shared between host and container.
It can be confusing in other cases, though. The issue is that the directory in the container may have the same path as the directory in the host, but have completely different contents. The old contents may actually be in /run/host/$PWD instead.
Switching to /run/host/$PWD unconditionally has its own downsides. For one, it's ugly, and also, in common cases, like subdirectories of the home directory, it's unnecessary.
This commit tries to find the balance, by making toolbx check first if the directory is shared between host and container, and if not, only then falling back to trying /run/host/$PWD.
Closes #988