Revert last two commits
This commit is contained in:
parent
8d33b4051f
commit
ec1705835c
52
neofetch
52
neofetch
|
@ -1739,35 +1739,37 @@ getfont () {
|
|||
# Terminal Emulator {{{
|
||||
|
||||
getterm () {
|
||||
# Workaround for OS X systems that
|
||||
# don't support the block below.
|
||||
case "$TERM_PROGRAM" in
|
||||
"iTerm.app") term="iTerm2" ;;
|
||||
"Terminal.app") term="Apple Terminal" ;;
|
||||
*) term="${TERM_PROGRAM/\.app}" ;;
|
||||
esac
|
||||
|
||||
# Check $PPID for terminal emulator.
|
||||
case "$os" in
|
||||
"Mac OS X")
|
||||
case "$TERM_PROGRAM" in
|
||||
"iTerm.app") term="iTerm2" ;;
|
||||
"Terminal.app") term="Apple Terminal" ;;
|
||||
*) term="${TERM_PROGRAM/\.app}" ;;
|
||||
esac
|
||||
;;
|
||||
if [ -z "$term" ]; then
|
||||
case "$os" in
|
||||
"Windows")
|
||||
parent="$(ps -p ${1:-$PPID} | awk '{printf $2}')"
|
||||
parent=${parent/'PPID'}
|
||||
|
||||
"Windows")
|
||||
parent="$(ps -p ${1:-$PPID} | awk '{printf $2}')"
|
||||
parent=${parent/'PPID'}
|
||||
name="$(ps -p $parent | awk '{printf $8}')"
|
||||
name=${name/'COMMAND'}
|
||||
name=${name/*\/}
|
||||
;;
|
||||
|
||||
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
|
||||
|
||||
*)
|
||||
parent="$(ps -p ${1:-$PPID} -o ppid=)"
|
||||
name="$(ps -p $parent -o comm=)"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$name" in
|
||||
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
||||
*) term="$name" ;;
|
||||
esac
|
||||
case "$name" in
|
||||
"${SHELL/*\/}" | *"sh" | "tmux" | "screen" | "systemd") getterm "$parent" ;;
|
||||
*) term="$name" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# }}}
|
||||
|
|
Reference in New Issue