Commit ec0ed23d authored by Dylan Araps's avatar Dylan Araps

Term: Add a fallback to ps.

parent 3618a4a1
...@@ -1452,10 +1452,15 @@ getterm() { ...@@ -1452,10 +1452,15 @@ getterm() {
name="${name/*\/}" name="${name/*\/}"
;; ;;
*) "Linux")
parent="$(grep -F "PPid:" "/proc/${1:-$PPID}/status")" parent="$(grep -F "PPid:" "/proc/${1:-$PPID}/status")"
name="$(< "/proc/${parent/PPid:[[:space:]]}/comm")" name="$(< "/proc/${parent/PPid:[[:space:]]}/comm")"
;; ;;
*)
parent="$(ps -p ${1:-$PPID} -o ppid=)"
name="$(ps -p $parent -o comm=)"
;;
esac esac
case "${name// }" in case "${name// }" in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment