Add more generic test for screen/byobu/tmux title
This commit is contained in:
parent
834d3ddea9
commit
c5e642a09f
@ -137,6 +137,7 @@ building:
|
||||
* `LP_ENABLE_FOSSIL`, if you want to have fossil informations
|
||||
* `LP_ENABLE_VCS_ROOT`, if you want to show VCS informations with root account
|
||||
* `LP_ENABLE_TITLE`, if you want to use the prompt as your terminal window's title
|
||||
* `LP_ENABLE_SCREEN_TITLE`, if you want to use the prompt as your screen window's title
|
||||
|
||||
Note that if required commands are not installed, enabling the
|
||||
corresponding feature will have no effect.
|
||||
|
10
liquidprompt
10
liquidprompt
@ -215,6 +215,7 @@ _lp_source_config()
|
||||
LP_ENABLE_VIRTUALENV=${LP_ENABLE_VIRTUALENV:-1}
|
||||
LP_ENABLE_VCS_ROOT=${LP_ENABLE_VCS_ROOT:-0}
|
||||
LP_ENABLE_TITLE=${LP_ENABLE_TITLE:-0}
|
||||
LP_ENABLE_SCREEN_TITLE=${LP_ENABLE_SCREEN_TITLE:-0}
|
||||
LP_DISABLED_VCS_PATH=${LP_DISABLED_VCS_PATH:-""}
|
||||
|
||||
LP_MARK_BATTERY=${LP_MARK_BATTERY:-"⌁"}
|
||||
@ -618,7 +619,7 @@ _lp_jobcount_color()
|
||||
# Tells if we are running in a terminal multiplexer
|
||||
_lp_in_multiplexer()
|
||||
{
|
||||
if [[ "$TERM" == "screen" ]] ; then
|
||||
if [[ "$TERM" == screen* ]] ; then
|
||||
echo -ne "in_multiplexer"
|
||||
fi
|
||||
}
|
||||
@ -1137,12 +1138,13 @@ _lp_title()
|
||||
# Escapes whill tells bash to ignore the non-printing control characters when calculating the width of the prompt.
|
||||
# Otherwise line editing commands will mess the cursor positionning
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
local title="${_LP_OPEN_ESC}${LP_TITLE_OPEN}${txt}${LP_TITLE_CLOSE}${_LP_CLOSE_ESC}"
|
||||
;;
|
||||
screen*)
|
||||
[[ "$LP_ENABLE_SCREEN_TITLE" != "1" ]] && return
|
||||
local title="${LP_SCREEN_TITLE_OPEN}${txt}${LP_SCREEN_TITLE_CLOSE}"
|
||||
;;
|
||||
*)
|
||||
local title="${_LP_OPEN_ESC}${LP_TITLE_OPEN}${txt}${LP_TITLE_CLOSE}${_LP_CLOSE_ESC}"
|
||||
;;
|
||||
esac
|
||||
echo -n "${title}"
|
||||
}
|
||||
|
@ -97,6 +97,9 @@ LP_ENABLE_TIME=0
|
||||
# feature to your specific terminal.
|
||||
LP_ENABLE_TITLE=0
|
||||
|
||||
# Enable Title for screen and byobu
|
||||
LP_ENABLE_SCREEN_TITLE=0
|
||||
|
||||
# Specify a list of complete and colon (":") separated paths in which, all vcs
|
||||
# will be disabled
|
||||
LP_DISABLED_VCS_PATH=""
|
||||
|
Loading…
Reference in New Issue
Block a user