diff options
-rw-r--r-- | README.markdown | 9 | ||||
-rw-r--r-- | bash/bashrc.d/prompt.bash | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/README.markdown b/README.markdown index b2fab759..ec6ef7a4 100644 --- a/README.markdown +++ b/README.markdown @@ -127,15 +127,16 @@ A terminal session with my prompt looks something like this: ~$ ssh remote tom@remote:~$ cd .dotfiles - tom@remote:~/.dotfiles(master+!)$ git status + tom@remote:~$ bash + >tom@remote:~/.dotfiles(master+!)$ git status M README.markdown M bash/bashrc.d/prompt.bash A init - tom@remote:~/.dotfiles(master+!)$ foobar + >tom@remote:~/.dotfiles(master+!)$ foobar foobar: command not found - tom@remote:~/.dotfiles(master+!)<127>$ sleep 5 & + >tom@remote:~/.dotfiles(master+!)<127>$ sleep 5 & [1] 28937 - tom@remote:~/.dotfiles(master+!){1}$ + >tom@remote:~/.dotfiles(master+!){1}$ The username and hostname are elided if not connected via SSH. The working directory is always shown. The rest of the prompt expands based on context to 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 |