Skip to content

Inherit environment variables on entering #29

Closed

Description

@mildred

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.

Activity

  1. debarshiray commented on Jan 11, 2019

    @debarshiray
    Member

    Yes, agreed. Running fedora-toolbox enter should as similar as possible to spawning a sub-shell.

  2. martymichal commented on Mar 16, 2020

    @martymichal
    Member

    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.

  3. debarshiray commented on Jun 26, 2020

    @debarshiray
    Member

    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.

  4. debarshiray commented on Jul 28, 2020

    @debarshiray
    Member

    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.

  5. ckupe commented on May 28, 2024

    @ckupe

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions