show running process tree and focus it's environ changes.
➜ rptree git:(master) ✗ mkdir build
➜ rptree git:(master) ✗ cd build
➜ build git:(master) ✗ cmake ..
➜ build git:(master) ✗ make
➜ build git:(master) ✗ ./rptree -- sh ../example/1.sh
script running in ../example/1.sh
timestamp: 2024-10-17 15:47:38
script running in /home/qianfan/debug/port/github-os/rptree/example/2.sh
Running process tree generated by rptree b00cc6295ad8271587b1
0.000 [15607] ./rptree -- sh ../example/1.sh
|.... 0.000 [15608] sh ../example/1.sh
|.... 0.001 [15609] sh ../example/1.sh
|.... 0.001 [15610] readlink -f ../example/1.sh
|.... 0.002 [15609] dirname /home/qianfan/debug/port/github-os/rptree/example/1.sh
|.... 0.002 [15611] /usr/bin/echo 'script running in ../example/1.sh'
\+ GLOBAL_ENV=env1
\+ SELF=../example/1.sh
|.... 0.003 [15612] sh ../example/1.sh
|.... 0.003 [15613] date '+%Y-%m-%d %H:%M:%S'
\+ GLOBAL_ENV=env1
\+ SELF=../example/1.sh
|.... 0.004 [15614] /usr/bin/echo 'timestamp: ' '2024-10-17 15:47:38'
\+ GLOBAL_ENV=env1
\+ SELF=../example/1.sh
|.... 0.005 [15615] sleep 5
\+ GLOBAL_ENV=env1
\+ SELF=../example/1.sh
|.... 5.006 [15619] sh /home/qianfan/debug/port/github-os/rptree/example/2.sh
\+ GLOBAL_ENV=env1
\+ SELF=../example/1.sh
|.... 5.007 [15620] /usr/bin/echo 'script running in /home/qianfan/debug/port/github-os/rptree/example/2.sh'
\- GLOBAL_ENV=env1
\- SELF=../example/1.sh
\+ GLOBAL_ENV=env2
\+ SELF=/home/qianfan/debug/port/github-os/rptree/example/2.sh