diff options
Diffstat (limited to '.bash_prompt')
| -rw-r--r-- | .bash_prompt | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/.bash_prompt b/.bash_prompt index 0cd8d4b..4777251 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -81,6 +81,7 @@ __fontify () local -A codes=( [bold]=1 [dim]=2 + [reverse]=7 [red]=31 [green]=32 [blue]=34 @@ -204,24 +205,41 @@ __refresh-terminal () __set-prompt } +__init-smart () +{ + ### Prompts. -PS2='… ' + PS2=$(__fontify '… ' dim) + export PS4=$(__fontify "${PS4}" reverse) -if [ "${TERM}" = dumb ] -then - PS1='$? \u:\w\$ ' - return -fi + if __have-gitprompt + then + . /usr/lib/git-core/git-sh-prompt + GIT_PS1_SHOWDIRTYSTATE=t + GIT_PS1_SHOWUPSTREAM=auto -PS2=$(__fontify "${PS2}" dim) + PS1_SHOWGITSTATUS=t + fi -if __have-gitprompt -then - . /usr/lib/git-core/git-sh-prompt - GIT_PS1_SHOWDIRTYSTATE=t - GIT_PS1_SHOWUPSTREAM=auto + PROMPT_COMMAND=__refresh-terminal - PS1_SHOWGITSTATUS=t -fi + ### Bindings. + + bind -f ~/.bash_inputrc -PROMPT_COMMAND=__refresh-terminal + # Unset the TTY's "stop" char, so that readline receives C-s. + if tty -s + then + stty stop '' + fi +} + + +if [ "${TERM}" = dumb ] +then + PS1='$? \u:\w\$ ' + PS2='> ' + export PS4='+ ' +else + __init-smart +fi |
