aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-11-30 10:24:20 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-11-30 10:24:20 +1300
commitcf8239d36adc1346a46058d05992d3310e27cc02 (patch)
tree7dd83e694acc67741a191de1575bb2d25b52cf1f /bash/bashrc.d
parent9cd6436b0bf4987cea845788a2d0a67ceac15b13 (diff)
downloaddotfiles-cf8239d36adc1346a46058d05992d3310e27cc02.tar.gz
dotfiles-cf8239d36adc1346a46058d05992d3310e27cc02.zip
Add > signs to show shell indentation level
This needs extension to handle tmux sessions; it should be something like SHLVL - TMUX_SHLVL, which I'm not quite sure how to implement yet.
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 906b730b..47a01962 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -31,6 +31,13 @@ prompt() {
# Add terminating "$" or "#" sign
PS1=$PS1'\$'
+ # Add > signs at the front of the prompt to show the current shell
+ # level
+ local i
+ for ((i = 0; i < SHLVL; i++)) ; do
+ PS1='>'$PS1
+ done
+
# Declare variables to contain terminal control strings
local format reset