From 134c5f601d6094fc476715c9a74afe613bcd328a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 14 Aug 2016 01:53:00 +1200 Subject: Rearrange prompt variable assignments a bit --- bash/bashrc.d/prompt.bash | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bash') 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=$( { -- cgit v1.2.3