Allow TERMINAL to be set by environment

This commit is contained in:
jphager2 2018-10-13 01:30:07 +02:00
parent f1f51de1d6
commit 0f0a45b7fc
1 changed files with 12 additions and 10 deletions

View File

@ -102,16 +102,18 @@ set_theme() {
# |
# | Check for the terminal name (depening on os)
# | ===========================================
OS=$(uname)
if [ "$OS" = "Darwin" ]; then
# |
# | Check for the terminal name and decide how to apply
# | ===========================================
TERMINAL=$TERM_PROGRAM
elif [ "${OS#CYGWIN}" != "${OS}" ]; then
TERMINAL="mintty"
else
TERMINAL="$(ps -p $(ps -p $(ps -p $$ -o ppid=) -o ppid=) -o args=)"
if [[ -z "$TERMINAL" ]]; then
OS=$(uname)
if [ "$OS" = "Darwin" ]; then
# |
# | Check for the terminal name and decide how to apply
# | ===========================================
TERMINAL=$TERM_PROGRAM
elif [ "${OS#CYGWIN}" != "${OS}" ]; then
TERMINAL="mintty"
else
TERMINAL="$(ps -p $(ps -p $(ps -p $$ -o ppid=) -o ppid=) -o args=)"
fi
fi
# |