iTerm2 detection

This commit is contained in:
Dylan Araps 2016-05-16 22:41:40 +10:00
parent e223b034ef
commit 6a96072efe

View file

@ -1738,6 +1738,10 @@ getfont () {
# Terminal Emulator {{{
getterm () {
[ -n "$ITERM_PROFILE" ] && term="iTerm2"
# Check $PPID for terminal emulator.
if [ -z "$term" ]; then
parent="$(ps -p ${1:-$PPID} -o ppid=)"
name="$(ps -p $parent -o comm=)"
@ -1745,6 +1749,7 @@ getterm () {
"${SHELL/*\/}" | *"sh" | "tmux") getterm "$parent" ;;
*) term="$name" ;;
esac
fi
}
# }}}