Default prefix put a classical prompt as title

Update the doc and themes accordingly
This commit is contained in:
nojhan 2013-01-04 14:08:26 +01:00
parent af43ec0eac
commit 947781bac9
4 changed files with 13 additions and 7 deletions

View File

@ -138,7 +138,7 @@ You can prefix the `LP_PS1` variable with anything you want using the
`LP_PS1_PREFIX`. The following example activate title change on xterm-like
windows:
export LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]"
LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]"
### PUT THE PROMPT IN A DIFFERENT ORDER

View File

@ -18,12 +18,13 @@
# LP_ERR last error code
# LP_MARK prompt mark
# LP_TIME current time
# LP_PS1_PREFIX user-defined general-purpose prefix
# Remember that most features come with their corresponding colors,
# see the README.
# add jobs, load and battery
LP_PS1="${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}"
# add time, jobs, load and battery
LP_PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}"
# add user, host and permissions colon
LP_PS1="${LP_PS1}[${LP_USER}${LP_HOST}${LP_PERM}"
@ -31,13 +32,15 @@ LP_PS1="${LP_PS1}[${LP_USER}${LP_HOST}${LP_PERM}"
if [[ "$EUID" -ne "0" ]]
then
# path in foreground color
LP_PS1="${LP_PS1}${LP_PWD}]${LP_PROXY}"
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
# add VCS infos
LP_PS1="${LP_PS1}${LP_GIT}${LP_HG}${LP_SVN}"
else
# path in yellow
LP_PS1="${LP_PS1}${LP_PWD}]${LP_PROXY}"
# do not add VCS infos
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
# do not add VCS infos unless told otherwise (LP_ENABLE_VCS_ROOT)
[[ "$LP_ENABLE_VCS_ROOT" = "1" ]] && \
LP_PS1="${LP_PS1}${LP_GIT}${LP_HG}${LP_SVN}"
fi
# add return code and prompt mark
LP_PS1="${LP_PS1}${LP_ERR}${LP_MARK}"

View File

@ -30,6 +30,9 @@ else
LP_MARK_UNTRACKED="*"
fi
# Use the prefix to change the title of the terminal window
LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]"
# Colors
# Available colors are:
# BOLD, BLACK, BOLD_GRAY, WHITE, BOLD_WHITE,

View File

@ -189,7 +189,7 @@ _lp_source_config()
LP_PATH_KEEP=${LP_PATH_KEEP:-2}
LP_HOSTNAME_ALWAYS=${LP_HOSTNAME_ALWAYS:-0}
LP_PS1=${LP_PS1:-""}
LP_PS1_PREFIX=${LP_PS1_PREFIX:-""}
LP_PS1_PREFIX=${LP_PS1_PREFIX:-"\[\e]0;\u@\h: \w\a\]"}
LP_ENABLE_PERM=${LP_ENABLE_PERM:-1}
LP_ENABLE_SHORTEN_PATH=${LP_ENABLE_SHORTEN_PATH:-1}