JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stop pretending what fg white is 0
authorJason Woofenden <jason@jasonwoof.com>
Wed, 30 Jan 2013 22:13:24 +0000 (17:13 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 30 Jan 2013 22:13:24 +0000 (17:13 -0500)
index.html
terminal.coffee

index 738d7d7..a7f1978 100644 (file)
                                return 'background-' + color_to_css((i&0x10000) | ((i&0xff00) >> 8));
                        };
                        var stylize = function (txt, style) {
                                return 'background-' + color_to_css((i&0x10000) | ((i&0xff00) >> 8));
                        };
                        var stylize = function (txt, style) {
-                               if (txt.length == 0 || style == 0) {
+                               if (txt.length == 0 || style == 0x000007) {
                                        return txt
                                }
                                css = ''
                                        return txt
                                }
                                css = ''
                                for (i in term.text) {
                                        div = $('<div>');
                                        txt = ''
                                for (i in term.text) {
                                        div = $('<div>');
                                        txt = ''
-                                       a = 0;
+                                       a = 0x000007;
                                        for (j in term.text[i]) {
                                                if (term.attributes[i][j] != a) {
                                                        if (txt.length) {
                                        for (j in term.text[i]) {
                                                if (term.attributes[i][j] != a) {
                                                        if (txt.length) {
index 7f80a76..e9cf540 100644 (file)
@@ -16,7 +16,7 @@ class Terminal
                @attributes = []
                @x = 0
                @y = 0
                @attributes = []
                @x = 0
                @y = 0
-               @a = 0 # cursor attributes
+               @a = 0x000007 # cursor attributes
                @partial = ''
                @resize width, height
        
                @partial = ''
                @resize width, height
        
@@ -113,7 +113,7 @@ class Terminal
 
                                # remove all style/color
                                when '' # leading zeros are removed (even if that's all of them)
 
                                # remove all style/color
                                when '' # leading zeros are removed (even if that's all of them)
-                                       @set_attribute_bits 0xffffff, 0
+                                       @set_attribute_bits 0xffffff, 0x000007
 
                                # style attributes
                                when '1' # bold
 
                                # style attributes
                                when '1' # bold
@@ -137,6 +137,9 @@ class Terminal
                                when '28' # not invisible
                                        @set_attribute_bits 0x80000, 0
 
                                when '28' # not invisible
                                        @set_attribute_bits 0x80000, 0
 
+                               when '100' # reset colors but not other attributes
+                                       @set_attribute_bits 0xffff, 0x0007
+
                                # 8 fg colors
                                when '30' # fg black
                                        @set_attribute_bits 0xff, 0x00
                                # 8 fg colors
                                when '30' # fg black
                                        @set_attribute_bits 0xff, 0x00