From de1015f6ac69610d197ecfc2cb1d68e8935f919c Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sun, 9 May 2021 20:45:22 +0200 Subject: [PATCH] When running a background process, always inherit env subprocess.Popen inherits the current environment if you pass env=None, but only sets the environment you pass when you pass something else. This causes an issue with using launch with --stdin-source and --type=background, e.g. that DISPLAY is not set so you can't launch graphical processes. Therefore, we have to include os.environ when we pass an env to Popen. Fixes #3602 --- kitty/boss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kitty/boss.py b/kitty/boss.py index 56e1fa956..028bd8b04 100755 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1221,6 +1221,8 @@ class Boss: cwd_from: Optional[int] = None ) -> None: import subprocess + if env: + env = {**os.environ, **env} if cwd_from: with suppress(Exception): cwd = cwd_of_process(cwd_from)