Preserve env vars from onvoking env when creating new os window via single instance

This commit is contained in:
Kovid Goyal
2025-04-23 22:14:06 +05:30
parent 2c2ddbb8f5
commit 87b218a40d
4 changed files with 10 additions and 4 deletions

View File

@@ -145,8 +145,8 @@ def environ_of_process(pid: int) -> dict[str, str]:
return parse_environ_block(_environ_of_process(pid))
def process_env() -> dict[str, str]:
ans = dict(os.environ)
def process_env(env: dict[str, str] | None = None) -> dict[str, str]:
ans = dict(os.environ if env is None else env)
ssl_env_var = getattr(sys, 'kitty_ssl_env_var', None)
if ssl_env_var is not None:
ans.pop(ssl_env_var, None)