Skip to contents

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.)

Usage

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=1109803, NAME=R, AT=2026-05-11 16:41:25.223517
#> 
#> [[2]]
#> <ps::ps_handle> PID=1108927, NAME=R, AT=2026-05-11 16:41:19.503517
#> 
#> [[3]]
#> <ps::ps_handle> PID=1108926, NAME=build-and-log-b, AT=2026-05-11 16:41:19.503517
#> 
#> [[4]]
#> <ps::ps_handle> PID=1108925, NAME=bash, AT=2026-05-11 16:41:19.503517
#> 
#> [[5]]
#> <ps::ps_handle> PID=913880, NAME=xargs, AT=2026-05-11 16:22:32.343517
#> 
#> [[6]]
#> <ps::ps_handle> PID=913655, NAME=bash, AT=2026-05-11 16:22:32.173517
#> 
#> [[7]]
#> <ps::ps_handle> PID=722717, NAME=bash, AT=2026-05-11 15:33:29.073517
#> 
#> [[8]]
#> <ps::ps_handle> PID=722370, NAME=rsession, AT=2026-05-11 15:33:16.023517
#> 
#> [[9]]
#> <ps::ps_handle> PID=722350, NAME=rsession-run, AT=2026-05-11 15:33:15.983517
#> 
#> [[10]]
#> <ps::ps_handle> PID=722348, NAME=sh, AT=2026-05-11 15:33:15.963517
#> 
#> [[11]]
#> <ps::ps_handle> PID=7024, NAME=rstudio-local-l, AT=2026-02-22 15:34:23.393517
#> 
#> [[12]]
#> <ps::ps_handle> PID=6996, NAME=rstudio-launche, AT=2026-02-22 15:34:23.343517
#> 
#> [[13]]
#> <ps::ps_handle> PID=1, NAME=systemd, AT=2026-02-22 15:30:21.633518
#>