You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entering the toolbox should keep as much from the original environment as possible to help have a seamless experience. This is a similar concern as issue #20. As such, I believe the environment variables should be inherited within the toolbox.
We currently use our own list of environment variables that we manually pass to podman create on container creation. I recently found a flag in podman create called --env-host that passes the host environment of the process executing Podman to the container.
I'll experiment with the option and maybe I'll replace the list with the option.
I recently found a flag in podman create called --env-host that passes the host
environment of the process executing Podman to the container.
Yes, that was added in Podman 1.5.0.
I wonder if it propagates only environment variables, or if it also includes shell functions.
I find myself going back and forth over this issue. Generally speaking, we have had a hard time managing environment variables in GNOME. They leak into places where you don't want them to, and don't when you want them to. So, the idea that the shell spawned by Toolbox is fresh seems somewhat attractive. What if you are on a Fedora host, and have the variables propagated into a Debian container? That could potentially lead to weird behaviour depending on exactly what you have in your environment.
Since HOME is shared with the host, environment variables could also be defined in the usual shell start-up scripts like ~/.bash_profile and ~/.bashrc.
So, I am curious if there any real world use-cases that are being hampered by not having environment variables from the host propagated into the container.
One important thing that has changed since my first comment is that the project is no longer called fedora-toolbox, but toolbox. This means that, at least in theory, the host and the container might not be the same operating system distribution. I'd be a lot more in favour of preserving the entire environment if we expected the host and the container to be the same.
Closing, but we can revisit this if some pressing real world use-case shows up.
@debarshiray I ran across this issue trying to use neovim in a toolbox. I want to use the inbuilt clipboard in my tmux session that is attached to my native host terminal emulator, so I have TMUX set on native shell, but when I enter toolbox, I run into a problem where TMUX is obviously not set upon entering the toolbox container. Thus, I lose clipboard integration.
Activity
debarshiray commentedon Jan 11, 2019
Yes, agreed. Running
fedora-toolbox entershould as similar as possible to spawning a sub-shell.martymichal commentedon Mar 16, 2020
We currently use our own list of environment variables that we manually pass to
podman createon container creation. I recently found a flag inpodman createcalled--env-hostthat passes the host environment of the process executing Podman to the container.I'll experiment with the option and maybe I'll replace the list with the option.
debarshiray commentedon Jun 26, 2020
Yes, that was added in Podman 1.5.0.
I wonder if it propagates only environment variables, or if it also includes shell functions.
I find myself going back and forth over this issue. Generally speaking, we have had a hard time managing environment variables in GNOME. They leak into places where you don't want them to, and don't when you want them to. So, the idea that the shell spawned by Toolbox is fresh seems somewhat attractive. What if you are on a Fedora host, and have the variables propagated into a Debian container? That could potentially lead to weird behaviour depending on exactly what you have in your environment.
Since
HOMEis shared with the host, environment variables could also be defined in the usual shell start-up scripts like~/.bash_profileand~/.bashrc.So, I am curious if there any real world use-cases that are being hampered by not having environment variables from the host propagated into the container.
debarshiray commentedon Jul 28, 2020
One important thing that has changed since my first comment is that the project is no longer called
fedora-toolbox, buttoolbox. This means that, at least in theory, the host and the container might not be the same operating system distribution. I'd be a lot more in favour of preserving the entire environment if we expected the host and the container to be the same.Closing, but we can revisit this if some pressing real world use-case shows up.
ckupe commentedon May 28, 2024
@debarshiray I ran across this issue trying to use neovim in a toolbox. I want to use the inbuilt clipboard in my tmux session that is attached to my native host terminal emulator, so I have TMUX set on native shell, but when I enter toolbox, I run into a problem where TMUX is obviously not set upon entering the toolbox container. Thus, I lose clipboard integration.