aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-18 13:59:10 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-18 13:59:10 +1300
commitd45d5d5effd9d2b133b8759ecd63318fae45673e (patch)
tree4b2b0487878a8ba45b8fa6a3466541052760f491 /bash/bashrc.d/prompt.bash
parentMore logical order for binscripts (diff)
downloaddotfiles-d45d5d5effd9d2b133b8759ecd63318fae45673e.tar.gz
dotfiles-d45d5d5effd9d2b133b8759ecd63318fae45673e.zip
Define PS{2..4}, including a nice PS4 for set -x
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r--bash/bashrc.d/prompt.bash10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index b4f0e735..9a96ed33 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -10,7 +10,7 @@ prompt() {
# What's done next depends on the first argument to the function
case $1 in
- # Turn complex, colored prompt on
+ # Turn complex, colored PS1 and debugging PS4 prompts on
on)
# Set up pre-prompt command and prompt format
PROMPT_COMMAND='declare -i PROMPT_RETURN=$? ; history -a'
@@ -53,12 +53,18 @@ prompt() {
# String it all together
PS1='\['"$format"'\]'"$PS1"'\['"$reset"'\] '
+ PS2='> '
+ PS3='? '
+ PS4='+<$?> ${BASH_SOURCE:-$BASH}:$FUNCNAME:$LINENO:'
;;
- # Revert to simple inexpensive prompt
+ # Revert to simple inexpensive prompts
off)
unset -v PROMPT_COMMAND PROMPT_DIRTRIM PROMPT_RETURN
PS1='\$ '
+ PS2='> '
+ PS3='? '
+ PS4='+ '
;;
git)