Extract shared prompt values and refactor bash/git prompts
Move color constants and PS1 escape sequences from bash-prompt.sh into a new shared rc/03-values.sh, and extract the user@host:dir fragment as LWS_PS1_USER_HOST to eliminate duplication between bash-prompt.sh and git-prompt.sh. Wire up git-prompt to use bash-git-prompt with the shared prompt variables.
This commit is contained in:
@@ -9,5 +9,8 @@ GIT_PROMPT_INIT="$GIT_PROMPT_PATH/gitprompt.sh"
|
||||
if [ -f "$GIT_PROMPT_INIT" ]; then
|
||||
export GIT_PROMPT_PATH
|
||||
GIT_PROMPT_ONLY_IN_REPO=1
|
||||
GIT_PROMPT_USER_HOST="${LWS_PS1_USER_HOST}"
|
||||
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${GIT_PROMPT_USER_HOST}"
|
||||
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"
|
||||
source "$GIT_PROMPT_INIT"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user