From cf8239d36adc1346a46058d05992d3310e27cc02 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 30 Nov 2016 10:24:20 +1300 Subject: 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. --- bash/bashrc.d/prompt.bash | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bash/bashrc.d/prompt.bash') 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 -- cgit v1.2.3