From 0f402aa0d82fb36bdbd48bf29c1f20d962ac9078 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 30 Jan 2013 23:28:26 -0500 Subject: [PATCH] make csi_J(0/1) clear part of current line too --- terminal.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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] = ' ' -- 1.7.10.4