Fix ps command flags for FreeBSD

This was reported by @duck in #45
This commit is contained in:
Bruno Sutic
2014-09-29 13:39:41 +02:00
parent a7fe9dcac3
commit 8fd38588c0
2 changed files with 10 additions and 1 deletions

View File

@ -10,8 +10,15 @@ exit_safely_if_empty_ppid() {
fi
}
ps_command_flags() {
case $(uname -s) in
FreeBSD) echo "-ao" ;;
*) echo "-eo" ;;
esac
}
full_command() {
ps -eo "ppid command" |
ps "$(ps_command_flags)" "ppid command" |
sed "s/^ *//" |
grep "^${PANE_PID}" |
cut -d' ' -f2-