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

when exiting, pwd should be transferred #5

Open
yannickwurm opened this issue Jan 12, 2015 · 1 comment
Open

when exiting, pwd should be transferred #5

yannickwurm opened this issue Jan 12, 2015 · 1 comment

Comments

@yannickwurm
Copy link
Member

currently you end up back where switch was launched

@yeban
Copy link
Contributor

yeban commented Jan 13, 2015

It's going to be a highly contrived solution, if at all possible.

Your shell starts switch (which is a Ruby process). Switch execs docker run. exec overwrites the current process with new process, keeping the same pid.

shell -> (ruby) -> docker

docker runs your shell or the given command as a separate process within container. switch biolinux will look like:

sudo [pid 1] -> bash [some pid]

Either on host, or in container I can get the cwd of current process by readlink /proc/<pid>/cwd (on Linux; using lsof on Mac). But there's no real way for the owner process (your shell) on host to get cwd of the shell running within the container. Either way, I don't see how to use that to set parent shell's cwd.


I would rather you see switch as similar to "opening a new tab". Changes done in new tab don't cause any changes in other tabs. If no, it should be possible to have container print cwd to console on quit. Then you can copy paste the path and cd yourself, or run switch as cd $(switch bioilinux).

yeban added a commit that referenced this issue Jan 13, 2015
…tainer.

Ideally, this would mount /Applications as well but it's turning up empty in
the container. Perhaps boot2docker is getting in the way?

Also, looks like external drives are mounted in the container as read only.

refers #5

Signed-off-by: Anurag Priyam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants