From 267cc95265c7a49084a24147e968c7dc18834992 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 19 Jan 2018 00:02:17 +0100 Subject: bashrc need to inline return_value_formater to escape color codes accordingly --- bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index e7aa2d1..808202d 100644 --- a/bashrc +++ b/bashrc @@ -92,9 +92,9 @@ function return_val_formater() { local ret=$1 local ret_str if [[ $ret == 0 ]]; then - ret_str="${BCol_BrightGreen}"; + ret_str='${BCol_BrightGreen}'; else - ret_str="${BCol_BrightRed}"; + ret_str='${BCol_BrightRed}'; fi ret_str+="$ret${BCol_NoColor}" echo -e "$ret_str"; @@ -107,7 +107,7 @@ function pwd_formater() { } export PS1="\[${BCol_BrightRed}\]::\[${BCol_MediumGray}\]\u\[${BCol_BrightRed}\]::\[${BCol_LightGray}\]\H\[${BCol_BrightRed}\]:\[${BCol_DarkGray}\]$(tty) \[${BCol_LightGray}\] - \[${BCol_DarkBlue}\]\w\n\ -\[${BCol_NoColor}\][\$(return_val_formater \$?)\[${BCol_NoColor}\]] \$>\[${BCol_NoColor}\] " +\[${BCol_NoColor}\][\$(ret=\$?; if [[ \$ret == 0 ]]; then echo \"\[${BCol_BrightGreen}\]\$ret\"; else echo \"\[${BCol_BrightRed}\]\$ret\"; fi)\[${BCol_NoColor}\]] \$> " export PROMPT_COMMAND="echo -e ''" -- cgit v1.2.3