Major fix for brackets in terminal multiplexer
Optimize terminal multiplexer detection by moving it to the initial loading instead of at each prompt display: the terminal multiplexer is always a parent process and that can not change during the shell life. This also fixes a major leak: LP_MARK_BRACKET_OPEN was growing at each prompt display when running in a terminal multiplexer. (check with: echo "$LP_MARK_BRACKET_OP" | od -c )
This commit is contained in:
parent
9daaaa9f4f
commit
2aaf7bb002
17
liquidprompt
17
liquidprompt
@ -321,6 +321,12 @@ unset _lp_source_config
|
|||||||
[[ "$LP_ENABLE_BZR" = 1 ]] && { command -v bzr > /dev/null || LP_ENABLE_BZR=0 ; }
|
[[ "$LP_ENABLE_BZR" = 1 ]] && { command -v bzr > /dev/null || LP_ENABLE_BZR=0 ; }
|
||||||
[[ "$LP_ENABLE_BATT" = 1 ]] && { command -v acpi >/dev/null || LP_ENABLE_BATT=0 ; }
|
[[ "$LP_ENABLE_BATT" = 1 ]] && { command -v acpi >/dev/null || LP_ENABLE_BATT=0 ; }
|
||||||
|
|
||||||
|
# If we are running in a terminal multiplexer, brackets are colored
|
||||||
|
if [[ "$TERM" == screen* ]]; then
|
||||||
|
LP_MARK_BRACKET_OPEN="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_BRACKET_OPEN}${NO_COL}"
|
||||||
|
LP_MARK_BRACKET_CLOSE="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_BRACKET_CLOSE}${NO_COL}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Escape the given strings
|
# Escape the given strings
|
||||||
# Must be used for all strings that may comes from remote sources,
|
# Must be used for all strings that may comes from remote sources,
|
||||||
# like VCS branch names
|
# like VCS branch names
|
||||||
@ -644,13 +650,6 @@ _lp_jobcount_color()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Tells if we are running in a terminal multiplexer
|
|
||||||
_lp_in_multiplexer()
|
|
||||||
{
|
|
||||||
[[ "$TERM" == screen* ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Display the return value of the last command, if different from zero
|
# Display the return value of the last command, if different from zero
|
||||||
_lp_return_value()
|
_lp_return_value()
|
||||||
{
|
{
|
||||||
@ -1375,10 +1374,6 @@ _lp_set_prompt()
|
|||||||
LP_TIME=$(_lp_sr "$(_lp_time)")
|
LP_TIME=$(_lp_sr "$(_lp_time)")
|
||||||
|
|
||||||
# in main prompt: no space
|
# in main prompt: no space
|
||||||
if _lp_in_multiplexer ; then
|
|
||||||
LP_MARK_BRACKET_OPEN="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_BRACKET_OPEN}${NO_COL}"
|
|
||||||
LP_MARK_BRACKET_CLOSE="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_BRACKET_CLOSE}${NO_COL}"
|
|
||||||
fi
|
|
||||||
LP_PROXY="$(_lp_proxy)"
|
LP_PROXY="$(_lp_proxy)"
|
||||||
|
|
||||||
# right of main prompt: space at left
|
# right of main prompt: space at left
|
||||||
|
Loading…
Reference in New Issue
Block a user