X-Git-Url: https://jasonwoof.com/gitweb/?p=watch-my-terminal.git;a=blobdiff_plain;f=terminal.coffee;h=751a53accdc55c5960b863221e0b0b94294c5694;hp=3c8c9a9a317c01ab525d09982ec7358e2df9e916;hb=0f402aa0d82fb36bdbd48bf29c1f20d962ac9078;hpb=f98881c2a5954799212ae89965f0886b7c2ad217 diff --git a/terminal.coffee b/terminal.coffee index 3c8c9a9..751a53a 100644 --- a/terminal.coffee +++ b/terminal.coffee @@ -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] = ' '