Browse Source

Fix regression from inclusion of real escapes

Inclusion of "real" \033 seemed to work but confused readline when
working with long history lines
Alois Mahdal 11 years ago
parent
commit
b7ddf51f79
1 changed files with 5 additions and 8 deletions
  1. 5
    8
      dotfiles/bash/post.bashrc

+ 5
- 8
dotfiles/bash/post.bashrc View File

10
 
10
 
11
 __make_ps1d() {
11
 __make_ps1d() {
12
     lastrv=$(cat /var/tmp/bash-rv/$$.lastrv)
12
     lastrv=$(cat /var/tmp/bash-rv/$$.lastrv)
13
-    if [ $lastrv -gt 126 ];
13
+    if [ $lastrv -gt 0 ];
14
     then
14
     then
15
-        echo " \$"
16
-    elif [ $lastrv -gt 0 ];
17
-    then
18
-        echo " \$"
15
+        echo "$lastrv"
19
     else
16
     else
20
-        echo " \$"
17
+        echo ""
21
     fi
18
     fi
22
 }
19
 }
23
 
20
 
35
     ps1G='$(__git_ps1 "(%s)")';
32
     ps1G='$(__git_ps1 "(%s)")';
36
     ps1g="$green$ps1G$normal";
33
     ps1g="$green$ps1G$normal";
37
     ps1D='$(__make_ps1d $?)';
34
     ps1D='$(__make_ps1d $?)';
38
-    ps1d="$ps1D";
39
-    echo "$svrc$ps1u@$ps1h:$ps1w$ps1g$ps1d$normal ";
35
+    ps1d="$red$ps1D$normal";
36
+    echo "$svrc$ps1u@$ps1h:$ps1w$ps1g$ps1d\$ ";
40
 }
37
 }
41
 
38
 
42
 make_ps2() {
39
 make_ps2() {