Fix a regression in 0.26.0 that caused kitty to no longer set the LANG environment variable on macOS

Happened because reading the locale uses cocoa APIs and they are not fork
safe, so it was moved to after prewarm forking, but at that point the
default child env had already been set.

Fixes #5439
This commit is contained in:
Kovid Goyal
2022-08-29 20:58:48 +05:30
parent 6253ee2a74
commit 22fbdbca40
3 changed files with 9 additions and 1 deletions

View File

@@ -168,6 +168,10 @@ def set_default_env(val: Optional[Dict[str, str]] = None) -> None:
setattr(default_env, 'lc_ctype_set_by_user', has_lctype)
def set_LANG_in_default_env(val: str) -> None:
default_env()['LANG'] = val
def openpty() -> Tuple[int, int]:
master, slave = os.openpty() # Note that master and slave are in blocking mode
os.set_inheritable(slave, True)