On second thoughts dont use foreground process env vars for kitten @ ls

Since the purpose of the env vars is mostly to recognize windows the
original env vars make more sense. Also I dislike changing behavior for
no good reason.
This commit is contained in:
Kovid Goyal
2023-10-25 12:12:16 +05:30
parent 24895f0225
commit 9c25a183db
3 changed files with 4 additions and 5 deletions

View File

@@ -78,8 +78,7 @@ Detailed list of changes
- Render Private Use Unicode symbols using two cells if the second cell contains a non-breaking space as well as a normal space
- kitten @ ls: Return the environment of the foreground process instead of the initial child process (:iss:`6749`)
- macOS: Fix a regression in the previous release that caused kitten @ ls to not report the environment variables for the default shell (:iss:`6749`)
0.30.1 [2023-10-05]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -386,9 +386,9 @@ class Child:
def environ(self) -> Dict[str, str]:
try:
assert self.pid is not None
return environ_of_process(self.pid)
return environ_of_process(self.pid) or self.final_env.copy()
except Exception:
return {}
return self.final_env.copy()
@property
def current_cwd(self) -> Optional[str]:

View File

@@ -654,7 +654,7 @@ class Window:
'pid': self.child.pid,
'cwd': self.child.current_cwd or self.child.cwd,
'cmdline': self.child.cmdline,
'env': self.child.foreground_environ or self.child.environ or self.child.final_env,
'env': self.child.environ or self.child.final_env,
'foreground_processes': self.child.foreground_processes,
'is_self': is_self,
'at_prompt': self.at_prompt,