Changeset 1839

Show
Ignore:
Timestamp:
10/22/06 14:31:44 (2 years ago)
Author:
jstenar
Message:

pyreadline: Change in handling of default color in write_color.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pyreadline/trunk/doc/ChangeLog

    r1838 r1839  
    33    * Added color descriptions to example ini file 
    44    * log inital color to debug file 
     5    * Changed handling of default color in ansi sequences to  
     6      keep ipython prompt color ok even if default color is bold. 
    57     
    682006-10-19 Jörgen Stenarson  <jorgen.stenarson -at- bostream.nu> 
  • pyreadline/trunk/pyreadline/ansi.py

    r1459 r1839  
    8585            m = escape_parts.match(chunk) 
    8686            if m: 
    87                 for part in m.group(1).split(";"): 
    88                     if part == "0": # No text attribute 
     87                parts=m.group(1).split(";") 
     88                if len(parts)==1 and parts[0]=="0":  #reset to default color 
     89                    attr = self.defaultstate.copy() 
     90                    continue 
     91                for part in parts: 
     92                    if part == "0": # Part of bigger escape sequence, don't use default bold setting 
    8993                        attr = self.defaultstate.copy() 
     94                        attr.bold=False 
    9095                    elif part == "7": # switch on reverse 
    9196                        attr.inverse=True