CYGWIN and it's not standard ps...
This commit is contained in:
parent
8b9a3ce90e
commit
f8e6dd980b
1 changed files with 15 additions and 2 deletions
13
neofetch
13
neofetch
|
@ -1749,8 +1749,21 @@ getterm () {
|
|||
|
||||
# Check $PPID for terminal emulator.
|
||||
if [ -z "$term" ]; then
|
||||
case "$os" in
|
||||
"Windows")
|
||||
parent="$(ps -p ${1:-$PPID} | awk '{printf $2}')"
|
||||
parent=${parent/'PPID'}
|
||||
|
||||
name="$(ps -p $parent | awk '{printf $8}')"
|
||||
name=${name/'COMMAND'}
|
||||
name=${name/*\/}
|
||||
;;
|
||||
|
||||
*)
|
||||
parent="$(ps -p ${1:-$PPID} -o ppid=)"
|
||||
name="$(ps -p $parent -o comm=)"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$name" in
|
||||
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
||||
|
|
Loading…
Reference in a new issue