From 5e63fca6068e02ae3a383b044470055f59b3fa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Sat, 28 Dec 2013 01:41:25 +0100 Subject: [PATCH] Fix LP_ENABLE_RUNTIME default value for zsh ... and avoid an invalid warning. --- liquidprompt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/liquidprompt b/liquidprompt index 22207bd..ed8a11e 100755 --- a/liquidprompt +++ b/liquidprompt @@ -242,12 +242,10 @@ _lp_source_config() LP_ENABLE_HG=${LP_ENABLE_HG:-1} LP_ENABLE_BZR=${LP_ENABLE_BZR:-1} LP_ENABLE_TIME=${LP_ENABLE_TIME:-0} - if $_LP_SHELL_bash - then + if $_LP_SHELL_bash; then LP_ENABLE_RUNTIME=${LP_ENABLE_RUNTIME:-1} else - [[ "$LP_ENABLE_RUNTIME" == 1 ]] && echo Unfortunately, runtime printing for zsh is not yet supported. Turn LP_ENABLE_RUNTIME off in your config to hide this message. - LP_ENABLE_RUNTIME=0 + LP_ENABLE_RUNTIME=${LP_ENABLE_RUNTIME:-0} fi LP_ENABLE_VIRTUALENV=${LP_ENABLE_VIRTUALENV:-1} LP_ENABLE_VCS_ROOT=${LP_ENABLE_VCS_ROOT:-0} @@ -358,6 +356,11 @@ case "$LP_OS" in *) [[ "$LP_ENABLE_BATT" = 1 ]] && { command -v acpi >/dev/null || LP_ENABLE_BATT=0 ; };; esac +if [[ "$LP_ENABLE_RUNTIME" == 1 ]] && ! $_LP_SHELL_bash; then + echo Unfortunately, runtime printing for zsh is not yet supported. Turn LP_ENABLE_RUNTIME off in your config to hide this message. + LP_ENABLE_RUNTIME=0 +fi + # If we are running in a terminal multiplexer, brackets are colored if [[ "$TERM" == screen* ]]; then LP_BRACKET_OPEN="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_BRACKET_OPEN}${NO_COL}"