Commit a06329db authored by Dylan Araps's avatar Dylan Araps

getterm: Use /proc/$PPID/comm instead of ps

parent 41c778f6
...@@ -1453,8 +1453,8 @@ getterm() { ...@@ -1453,8 +1453,8 @@ getterm() {
;; ;;
*) *)
parent="$(ps -p ${1:-$PPID} -o ppid=)" parent="$(grep -F "PPid:" "/proc/${1:-$PPID}/status")"
name="$(ps -p $parent -o comm=)" name="$(< "/proc/${parent/PPid:[[:space:]]}/comm")"
;; ;;
esac esac
......
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