From f8e6dd980b05b003472ef9e648e57afc4381c097 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 18 May 2016 15:51:25 +1000 Subject: [PATCH] CYGWIN and it's not standard ps... --- neofetch | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 39bc0b1f..5f00800b 100755 --- a/neofetch +++ b/neofetch @@ -1749,8 +1749,21 @@ getterm () { # Check $PPID for terminal emulator. if [ -z "$term" ]; then - parent="$(ps -p ${1:-$PPID} -o ppid=)" - name="$(ps -p $parent -o comm=)" + 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" ;;