aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-14 01:53:00 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-14 01:53:00 +1200
commit134c5f601d6094fc476715c9a74afe613bcd328a (patch)
treefaff47ae9fe5c124d8bcb3fc82ca3fc0c18d57c4 /bash
parentUse --quiet flag for prompt git-rev-parse(1) call (diff)
downloaddotfiles-134c5f601d6094fc476715c9a74afe613bcd328a.tar.gz
dotfiles-134c5f601d6094fc476715c9a74afe613bcd328a.zip
Rearrange prompt variable assignments a bit
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/prompt.bash22
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=$( {