Merge branch 'background-process-always-inherit-env' of https://github.com/trygveaa/kitty

This commit is contained in:
Kovid Goyal 2021-05-10 06:11:31 +05:30
commit cfd731c376
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -15,7 +15,7 @@
)
from weakref import WeakValueDictionary
from .child import cached_process_data, cwd_of_process
from .child import cached_process_data, cwd_of_process, default_env
from .cli import create_opts, parse_args
from .cli_stub import CLIOptions
from .conf.utils import BadLine, to_cmdline
@ -1221,6 +1221,11 @@ def run_background_process(
cwd_from: Optional[int] = None
) -> None:
import subprocess
env = env or None
if env:
env_ = default_env().copy()
env_.update(env)
env = env
if cwd_from:
with suppress(Exception):
cwd = cwd_of_process(cwd_from)