Unverified Commit e3eb48ba authored by Mark Vander Stel's avatar Mark Vander Stel
Browse files

Merge branch 'cmm/leave-promptvars-alone'

parents 4ce49d1f ecdde384
......@@ -49,7 +49,8 @@ if test -n "${BASH_VERSION-}"; then
# Must be used for all strings injected in PS1 that may comes from remote sources,
# like $PWD, VCS branch names...
__lp_escape() {
ret="${1//\\/\\\\}"
local arg="${1//\\/\\\\}"
ret="${arg//\$/\\\$}"
}
elif test -n "${ZSH_VERSION-}" ; then
# Check for recent enough version of zsh.
......@@ -3026,7 +3027,6 @@ 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=""
_LP_ZSH_PROMPT_THEME=""
......@@ -3058,8 +3058,6 @@ prompt_on() {
declare -g +x PROMPT_COMMAND
fi
# Disable parameter/command expansion from PS1
shopt -u promptvars
PROMPT_COMMAND=__lp_set_prompt
(( LP_DEBUG_TIME )) && PROMPT_COMMAND="time $PROMPT_COMMAND" || true
else # zsh
......@@ -3085,7 +3083,6 @@ prompt_on() {
prompt_off() {
PS1=$LP_OLD_PS1
if (( _LP_SHELL_bash )); then
eval "$_LP_OLD_SHOPT"
PROMPT_COMMAND="$LP_OLD_PROMPT_COMMAND"
else # zsh
add-zsh-hook -d precmd "$_LP_ZSH_HOOK"
......@@ -3098,7 +3095,6 @@ prompt_off() {
prompt_OFF() {
PS1="$_LP_MARK_SYMBOL "
if (( _LP_SHELL_bash )); then
shopt -u promptvars
PROMPT_COMMAND="$LP_OLD_PROMPT_COMMAND"
else # zsh
add-zsh-hook -d precmd "$_LP_ZSH_HOOK"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment