CYGWIN and it's not standard ps...
This commit is contained in:
parent
8b9a3ce90e
commit
f8e6dd980b
17
neofetch
17
neofetch
|
@ -1749,8 +1749,21 @@ getterm () {
|
||||||
|
|
||||||
# Check $PPID for terminal emulator.
|
# Check $PPID for terminal emulator.
|
||||||
if [ -z "$term" ]; then
|
if [ -z "$term" ]; then
|
||||||
parent="$(ps -p ${1:-$PPID} -o ppid=)"
|
case "$os" in
|
||||||
name="$(ps -p $parent -o comm=)"
|
"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
|
case "$name" in
|
||||||
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
||||||
|
|
Reference in New Issue