| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
table (#5324)
* build(deps): bump sysinfo to 0.37 for scan-free partial process refresh
Bump it to pull in sysinfo 0.37's change "Linux: greatly improve partial
processes retrieval", so that refreshing a specific set of pids
(ProcessesToUpdate::Some) no longer walks the entire /proc tree.
This makes the existing get_cwd/get_cwds polling O(panes) instead of
O(host processes) and unblocks doing the same for foreground-command discovery.
* perf: discover foreground pane commands w/o scanning all processes
Foreground command discovery was reading information about every process
on the host, on each pane/tab creation and on every periodic poll. On hosts
with many processes (eg, 50k) this stalled pane creation for tens of seconds
and overran the action-completion timeout.
Replace that O(host processes) lookup with an O(panes) lookup. Instead
of looking up the parent pid of every process to find the child, get
the foreground process-group leader's pid from a call to tcgetpgrp on
the pane's controlling terminal. When the leader is the shell itself
(idle prompt or a command sharing the shell's group without job control)
the pane is omitted and the caller falls back to the shell command,
matching prior behavior; with job control on it now reports the true
foreground job instead of possibly a background one.
This changes the paths for Linux, macOS, and BSD. It leaves Windows unchanged.
* refactor(os_input): extract apply_post_command_hook helper
The command -> run_command_hook -> trim/split pipeline was duplicated between
the #[cfg(not(unix))] get_all_cmds_by_ppid and the unix get_foreground_cmds.
Extract a single apply_post_command_hook helper and call it from both sites,
routing the hook-failure fallback through the project's non_fatal() logging
idiom (CONTRIBUTING.md "Logging errors") instead of log::error!.
* review: simplify tcgetpgrp locking, trim comments, drop changelog entries
- Remove the lock-drop dance and its TOCTOU caveat from tcgetpgrp,
to make it mirror tcdrain
- Prune AI comments
- Remove CHANGELOG entries
|