Skip to content

Commit

Permalink
DRYer
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Mar 9, 2025
1 parent dc888a8 commit adaa007
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kitty/child.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,10 @@ def background_processes(self) -> list[ProcessDesc]:
sid = session_id(gmap.get(foreground_process_group_id, ()))
if sid < 0:
return []
ans = []
ans: list[ProcessDesc] = []
for grp_id, pids in gmap.items():
if grp_id != foreground_process_group_id and session_id(pids) == sid:
for pid in pids:
ans.append(self.process_desc(pid))
ans.extend(map(self.process_desc, pids))
return ans
except Exception:
return []
Expand Down

0 comments on commit adaa007

Please sign in to comment.