mirror of https://github.com/gpakosz/.tmux.git
considering the first child of a process ps output is sorted by controlling terminal then pid in case of a cmd1 | cmd2 | cmd3 pipe chain, we only consider the first child of the parent process, which is cmd1 in the majority of cases the rare situation when pids wrap around isn't worth additional work on Linux - we sort ps output by lstart in hope precision is enough to make cmd1 always appear first even when pids wrap around - the more complex solution involves inspecting /proc/<pid>/fd/0 to filter out processes being piped to finally, while lsof was promising, it won't list processes owned by other users unless run as rootpull/569/head
parent
69f744117a
commit
1ef9b68d80
Loading…
Reference in new issue