summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashprompt24
1 files changed, 13 insertions, 11 deletions
diff --git a/.bashprompt b/.bashprompt
index d7a6a54..0ce903f 100644
--- a/.bashprompt
+++ b/.bashprompt
@@ -40,14 +40,14 @@ __fontify ()
codes[dim]='2'
codes[clear]='0'
- local string=$1
+ local text=$1
shift
# We need to add \[ \] around CSI sequences so that Bash can tell which
# characters are non-printing.
- __start-nonprinting
- echo -en '\033['
+ output=$(__start-nonprinting)
+ output+='\033['
local attributes=($@)
local nb=$#
@@ -55,22 +55,24 @@ __fontify ()
for ((i=0; i<nb; i++))
do
a=${attributes[${i}]}
- echo -en ${codes[${a}]}
+ output+=${codes[${a}]}
if ((i<nb-1))
then
- echo -en ';'
+ output+=';'
else
- echo -en 'm'
+ output+='m'
fi
done
- __end-nonprinting
+ output+=$(__end-nonprinting)
- echo -n "${string}"
- __start-nonprinting
- echo -en "\033[0m"
- __end-nonprinting
+ output+="${text}"
+ output+=$(__start-nonprinting)
+ output+='\033[0m'
+ output+=$(__end-nonprinting)
+
+ echo -en "${output}"
}
__set-prompt ()