From 252526f36e0f8eade4e7de39fa4182d5c3c5ff29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Tue, 7 Jan 2014 22:22:09 +0100 Subject: [PATCH] Do not load if $TERM is not valide (fixes #161) --- liquidprompt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 7e42413..282f0ba 100755 --- a/liquidprompt +++ b/liquidprompt @@ -50,8 +50,11 @@ # See the README.md file for a summary of features. +# Issue #161: do not load if not an interactive shell +test -z "$TERM" -o "x$TERM" = dumb && return + # Check for recent enough version of bash. -if test -n "$BASH_VERSION" -a -n "$PS1" -a -n "$TERM" ; then +if test -n "$BASH_VERSION" -a -n "$PS1" ; then bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} if [[ $bmajor -lt 3 ]] || [[ $bmajor -eq 3 && $bminor -lt 2 ]]; then unset bash bmajor bminor