From 62f0270888ec668ec50df2af826727ca8ba9d6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Mon, 30 Jun 2014 19:42:51 +0200 Subject: [PATCH] bash: save and set shell option promptvars --- liquidprompt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/liquidprompt b/liquidprompt index 0ae0d27..279f380 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1721,11 +1721,13 @@ prompt_on() LP_OLD_PS1="$PS1" if $_LP_SHELL_bash; then LP_OLD_PROMPT_COMMAND="$PROMPT_COMMAND" + LP_OLD_SHOPT="$(shopt -p promptvars)" else # zsh LP_OLD_PROMPT_COMMAND="$(whence -f precmd)" fi fi if $_LP_SHELL_bash; then + shopt -s promptvars PROMPT_COMMAND=_lp_set_prompt [[ "$LP_DEBUG_TIME" == 1 ]] && PROMPT_COMMAND="time $PROMPT_COMMAND" else # zsh @@ -1752,6 +1754,7 @@ prompt_off() { PS1=$LP_OLD_PS1 if $_LP_SHELL_bash; then + eval "$LP_OLD_SHOPT" PROMPT_COMMAND="$LP_OLD_PROMPT_COMMAND" else # zsh precmd() { : ; } @@ -1764,6 +1767,7 @@ prompt_OFF() { PS1="\$ " if $_LP_SHELL_bash; then + shopt -u promptvars PROMPT_COMMAND="$LP_OLD_PROMPT_COMMAND" else # zsh precmd() { : ; }