aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-09 14:19:10 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-09 14:19:10 +1200
commitdba9fd867350c9203bf93ef485c89e0dcc5197d2 (patch)
treeb2bb1ad7357f66b8c47e22c84be333e3751e5cc9 /bash/bashrc.d/prompt.bash
parentUse two more history options (diff)
downloaddotfiles-dba9fd867350c9203bf93ef485c89e0dcc5197d2.tar.gz
dotfiles-dba9fd867350c9203bf93ef485c89e0dcc5197d2.zip
Allow PROMPT_PREFIX and PROMPT_SUFFIX
Also break the prompt definition into multiple lines for readability
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r--bash/bashrc.d/prompt.bash13
1 files changed, 11 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 7b12a2a2..68c8eb37 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -12,9 +12,18 @@ prompt() {
# Turn complex, colored PS1 and debugging PS4 prompts on
on)
- # Set up pre-prompt command and prompt format
+ # Set up pre-prompt command
PROMPT_COMMAND='declare -i PROMPT_RETURN=$? ; history -a'
- PS1='[\u@\h:\w]$(prompt job)$(prompt vcs)$(prompt ret)\$'
+
+ # Set up prompt, including optional PROMPT_PREFIX and PROMPT_SUFFIX
+ # variables
+ PS1='[\u@\h:\w]'
+ PS1=$PS1'$(prompt job)'
+ PS1=$PS1'$(prompt vcs)'
+ 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 ((10#${BASH_VERSINFO[0]%%[![:digit:]]*} >= 4)) ; then