diff options
author | johannst <stoelp@eit.uni-kl.de> | 2018-01-19 00:02:17 +0100 |
---|---|---|
committer | johannst <stoelp@eit.uni-kl.de> | 2018-01-19 00:02:17 +0100 |
commit | 267cc95265c7a49084a24147e968c7dc18834992 (patch) | |
tree | 91647e1d00abc7c3d933f1fb13eb90fe6c3961e2 /bashrc | |
parent | d7fd15790ca16d1a5d34bc830748ad0d91ab3ba4 (diff) | |
download | dotfiles-267cc95265c7a49084a24147e968c7dc18834992.tar.gz dotfiles-267cc95265c7a49084a24147e968c7dc18834992.zip |
bashrc need to inline return_value_formater to escape color codes accordingly
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 ''" |