diff options
-rw-r--r-- | bash/bashrc.d/prompt.bash | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index a0711d26..a0510df5 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -18,21 +18,23 @@ prompt() { # Set up pre-prompt command PROMPT_COMMAND='PROMPT_RETURN=$? ; history -a' - # Set up prompt, including optional PROMPT_PREFIX and PROMPT_SUFFIX - # variables - PS1='[\u@\h:\w]' - PS1=$PS1'$(prompt vcs)' - PS1=$PS1'$(prompt job)' - PS1=$PS1'$(prompt ret)' - PS1='${PROMPT_PREFIX}'$PS1 - PS1=$PS1'${PROMPT_SUFFIX}' - PS1=$PS1'\$' - # If Bash 4.0 is available, trim very long paths in prompt if ((BASH_VERSINFO[0] >= 4)) ; then PROMPT_DIRTRIM=4 fi + # Basic prompt shape + PS1='[\u@\h:\w]' + + # Add sub-commands; VCS, job, and return status checks + PS1=$PS1'$(prompt vcs)$(prompt job)$(prompt ret)' + + # Add prefix and suffix + PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}' + + # Add terminating "$" or "#" sign + PS1=$PS1'\$' + # Count available colors local -i colors colors=$( { |