From: Jason Woofenden Date: Thu, 31 Jan 2013 04:28:26 +0000 (-0500) Subject: make csi_J(0/1) clear part of current line too X-Git-Tag: v1.0~26 X-Git-Url: https://jasonwoof.com/gitweb/?p=watch-my-terminal.git;a=commitdiff_plain;h=0f402aa0d82fb36bdbd48bf29c1f20d962ac9078;hp=f98881c2a5954799212ae89965f0886b7c2ad217 make csi_J(0/1) clear part of current line too --- 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] = ' '