From 6057b3753b71d355e3404401603c39b868cb632c Mon Sep 17 00:00:00 2001 From: rhjdvsgsgks <26178113+rhjdvsgsgks@users.noreply.github.com> Date: Wed, 24 Apr 2024 02:31:36 +0000 Subject: [PATCH] option to keep env --- sandwine/_main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sandwine/_main.py b/sandwine/_main.py index a832a8f..e26ccb5 100644 --- a/sandwine/_main.py +++ b/sandwine/_main.py @@ -170,6 +170,10 @@ def parse_command_line(args): help='on non-zero exit code run PROGRAM a second time' '; helps to workaround weird graphics-related crashes' ' (default: run command once)') + general.add_argument('--keep-env', + dest='keep_env', + action='store_true', + help='keep host env (default: keep-env disabled)') return parser.parse_args(args) @@ -388,7 +392,8 @@ def create_bwrap_argv(config): env_tasks['PATH'] = os.pathsep.join(available_paths) # Create environment (meaning environment variables) - argv.add('--clearenv') + if not config.keep_env: + argv.add('--clearenv') for env_var, env_value in sorted(env_tasks.items(), key=itemgetter(0)): if env_value is None: env_value = os.environ.get(env_var)