Query the parent processes recursively, up to the first process. (On some platforms, like Windows, the process tree is not a tree and may contain loops, in which case ps_descent() only goes up until the first repetition.)

ps_descent(p = ps_handle())

Arguments

p

Process handle.

Value

A list of process handles, starting with p, each one is the parent process of the previous one.

Examples

ps_descent()
#> [[1]]
#> <ps::ps_handle> PID=4139632, NAME=R, AT=2025-10-29 18:06:27.39
#> 
#> [[2]]
#> <ps::ps_handle> PID=4139250, NAME=R, AT=2025-10-29 18:06:21.28
#> 
#> [[3]]
#> <ps::ps_handle> PID=4139249, NAME=build-and-log-b, AT=2025-10-29 18:06:21.26
#> 
#> [[4]]
#> <ps::ps_handle> PID=4139248, NAME=bash, AT=2025-10-29 18:06:21.26
#> 
#> [[5]]
#> <ps::ps_handle> PID=4107168, NAME=xargs, AT=2025-10-29 17:56:11.31
#> 
#> [[6]]
#> <ps::ps_handle> PID=4107026, NAME=bash, AT=2025-10-29 17:56:11.21
#> 
#> [[7]]
#> <ps::ps_handle> PID=1724250, NAME=bash, AT=2025-10-27 13:40:23.32
#> 
#> [[8]]
#> <ps::ps_handle> PID=1723632, NAME=rsession, AT=2025-10-27 13:39:33.12
#> 
#> [[9]]
#> <ps::ps_handle> PID=1723612, NAME=rsession-run, AT=2025-10-27 13:39:33.09
#> 
#> [[10]]
#> <ps::ps_handle> PID=1723610, NAME=sh, AT=2025-10-27 13:39:33.06
#> 
#> [[11]]
#> <ps::ps_handle> PID=3956, NAME=rstudio-local-l, AT=2025-10-25 02:17:50.25
#> 
#> [[12]]
#> <ps::ps_handle> PID=3950, NAME=rstudio-launche, AT=2025-10-25 02:17:50.23
#> 
#> [[13]]
#> <ps::ps_handle> PID=1, NAME=systemd, AT=2025-10-25 02:16:10.14
#>