Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: prompt theme system improvements



Adam Spiers, on thelonious (adam@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
> OK, finally here's a patch to the prompt system which vastly improves
> it.

I forgot Misc/bash2zshprompt.  Doh.

Index: Misc/bash2zshprompt
===================================================================
RCS file: /projects/zsh/zsh/Misc/bash2zshprompt,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 bash2zshprompt
--- Misc/bash2zshprompt	1999/10/15 13:07:14	1.1.1.3
+++ Misc/bash2zshprompt	1999/11/18 15:42:04
@@ -10,7 +10,7 @@
 my @colours = qw/grey red green yellow blue magenta cyan white/;
 
 my @codes = ();
-my %bold;
+my %boldp;
 my $out = '';
 
 print "# Converted to zsh prompt theme by bash2zshprompt, written by <adam\@spiers.net>\n";
@@ -80,21 +80,22 @@
               ($p[1] eq '4') ? 'bg' :
               '???');
 
-  $bold{$fgbg} ||= '';
+  $boldp{$fgbg} ||= '';
 
   if ($p[0] =~ /^0?0$/) {
-    $bold{$fgbg} = '';
+    $boldp{$fgbg} = '';
     return '$reset_color';
   }
   
   if ($p[0] =~ /^0?1$/) {
-    $bold{$fgbg} = 'bold_';
+    $boldp{$fgbg} = 'bold_';
     return '$bold_color';
   }
 
   return '$' .
-         "${fgbg}_$bold{$fgbg}" .
-         $colours[$p[2]];
+         "${fgbg}$boldp{$fgbg}\[" .
+         $colours[$p[2]] .
+         ']';
 }
 
 sub split_codes {



Messages sorted by: Reverse Date, Date, Thread, Author