summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_prompt20
1 files changed, 11 insertions, 9 deletions
diff --git a/.bash_prompt b/.bash_prompt
index 4777251..8b280e5 100644
--- a/.bash_prompt
+++ b/.bash_prompt
@@ -58,11 +58,11 @@ __set-title ()
echo -ne "\E]2;${title}\a"
}
-# In order to know how much space PS1 takes, Bash needs us to delimit
-# non-printing characters with \[ and \].
+# In order to know how much space a prompt takes, Bash needs us to
+# delimit non-printing characters with \[ and \].
__start-nonprinting ()
{
- if [ ${BUILDING_PS1} ]
+ if [ ${BUILDING_PS} ]
then
echo -en '\['
fi
@@ -70,7 +70,7 @@ __start-nonprinting ()
__end-nonprinting ()
{
- if [ ${BUILDING_PS1} ]
+ if [ ${BUILDING_PS} ]
then
echo -en '\]'
fi
@@ -118,11 +118,11 @@ __fontify ()
__set-prompt ()
{
- BUILDING_PS1=t
+ BUILDING_PS=t
PS1="$(__write-context)\n$(__fontify '\$' dim) "
- unset BUILDING_PS1
+ unset BUILDING_PS
}
__current-column ()
@@ -209,9 +209,6 @@ __init-smart ()
{
### Prompts.
- PS2=$(__fontify '… ' dim)
- export PS4=$(__fontify "${PS4}" reverse)
-
if __have-gitprompt
then
. /usr/lib/git-core/git-sh-prompt
@@ -223,6 +220,11 @@ __init-smart ()
PROMPT_COMMAND=__refresh-terminal
+ PS2=$(
+ BUILDING_PS=t
+ __fontify '… ' dim
+ )
+
### Bindings.
bind -f ~/.bash_inputrc