JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
make csi_J(0/1) clear part of current line too
authorJason Woofenden <jason@jasonwoof.com>
Thu, 31 Jan 2013 04:28:26 +0000 (23:28 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 31 Jan 2013 04:28:26 +0000 (23:28 -0500)
terminal.coffee

index 3c8c9a9..751a53a 100644 (file)
@@ -132,15 +132,21 @@ class Terminal
                @x = column
                @y = row
 
-       # clear lines (implemented inclusive of the current line)
+       # clear to screen edge(es)
        csi_J: (direction) ->
                switch @fix_esc_arg direction, '0'
                        when '0' # erase down
+                               # rest of current line
+                               @csi_K direction
+                               # rest of lines
                                for row in [@y...@height]
                                        for i in [0...@width]
                                                @text[row][i] = ' '
                                                @attributes[row][i] = @a
                        when '1' # erase up
+                               # beginning of current line
+                               @csi_K direction
+                               # all previous lines
                                for row in [0..@y]
                                        for i in [0...@width]
                                                @text[row][i] = ' '