From e223b034ef4cf69f4540f7c3ce5c7ee8f1f6de84 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 16 May 2016 22:29:08 +1000 Subject: [PATCH 1/2] Find ppid of tmux --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 76a9735d..cd920066 100755 --- a/neofetch +++ b/neofetch @@ -1742,7 +1742,7 @@ getterm () { name="$(ps -p $parent -o comm=)" case "$name" in - "${SHELL/*\/}" | *"sh") getterm "$parent" ;; + "${SHELL/*\/}" | *"sh" | "tmux") getterm "$parent" ;; *) term="$name" ;; esac } From 6a96072efe5017b02edb2510ef4f9bbcee887cbf Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 16 May 2016 22:41:40 +1000 Subject: [PATCH 2/2] iTerm2 detection --- neofetch | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index cd920066..e75db2db 100755 --- a/neofetch +++ b/neofetch @@ -1738,13 +1738,18 @@ getfont () { # Terminal Emulator {{{ getterm () { - parent="$(ps -p ${1:-$PPID} -o ppid=)" - name="$(ps -p $parent -o comm=)" + [ -n "$ITERM_PROFILE" ] && term="iTerm2" - case "$name" in - "${SHELL/*\/}" | *"sh" | "tmux") getterm "$parent" ;; - *) term="$name" ;; - esac + # Check $PPID for terminal emulator. + if [ -z "$term" ]; then + parent="$(ps -p ${1:-$PPID} -o ppid=)" + name="$(ps -p $parent -o comm=)" + + case "$name" in + "${SHELL/*\/}" | *"sh" | "tmux") getterm "$parent" ;; + *) term="$name" ;; + esac + fi } # }}}