Add logic to remove duplicate shell from args

This commit is contained in:
Jay W 2022-02-01 19:06:23 +00:00
parent 967f039e60
commit 886412fcf1
1 changed files with 5 additions and 0 deletions

View File

@ -413,6 +413,11 @@ def get_flatpak_args(args, envv, cwd):
"flatpak-spawn", "--host", "--watch-bus", "--forward-fd=1",
"--forward-fd=2", "--directory={}".format(cwd)
]
# Detect and remove duplicate shell in args
# to work around vte.spawn_sync() requirement.
if len(set([args[0], args[1]])) == 1:
del args[0]
flatpak_args = flatpak_spawn + env_args + args
dbg('returned flatpak args: %s' % flatpak_args)