diff --git a/README.md b/README.md index 65108ee..711b0ed 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/liquidprompt b/liquidprompt index 8cc7893..f2af2bf 100755 --- a/liquidprompt +++ b/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}" } diff --git a/liquidpromptrc-dist b/liquidpromptrc-dist index 9624258..731d2ce 100644 --- a/liquidpromptrc-dist +++ b/liquidpromptrc-dist @@ -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=""