From 9d68fe5513508cde8f6277a23d72e3234cabe913 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 18 Jun 2015 17:17:37 +0200 Subject: [Funcs] _process_tree: Adds « -f » option for full command-line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01_Internal.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/01_Internal.zsh b/01_Internal.zsh index 881ec07..9c8ebfd 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -683,12 +683,24 @@ zle -N _rehash # Process helper _process_tree() { + FULLCMD=0 + if [ "$1" = "-f" ] + then + FULLCMD=1 + shift + fi + for leaf in ${@:-$$} do - ps -eo pid,ppid,command | awk -v leaf="$leaf" \ + ps -wweo pid,ppid,command | awk -v fullcmd=$FULLCMD -v leaf="$leaf" \ '{ parent[$1]=$2 ; command[$1]=$3 ; + if (fullcmd && NF>=4) { + for (i=4; i<=NF; i++) { + command[$1]=command[$1]" "$i ; + } + } } function print_ancestry(pid) { -- cgit v1.2.3