hterm: Make ED erase the entire display
* ED erases the entire display, not the scroll area.
BUG=none
TEST=test_harness.html, 59/59 tests passed.
Change-Id: I9a9fa886a5cf993d447d05762c7e76c4b4c50f15
Reviewed-on: https://gerrit.chromium.org/gerrit/21926
Commit-Ready: David Benjamin <davidben@chromium.org>
Tested-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
diff --git a/hterm/js/terminal.js b/hterm/js/terminal.js
index 8583314..a3a14ed 100644
--- a/hterm/js/terminal.js
+++ b/hterm/js/terminal.js
@@ -1277,8 +1277,8 @@
};
/**
- * Erase all characters from the start of the scroll region to the current
- * cursor position.
+ * Erase all characters from the start of the screen to the current cursor
+ * position, regardless of scroll region.
*
* The cursor position is unchanged.
*
@@ -1290,8 +1290,7 @@
this.eraseToLeft();
- var top = this.getVTScrollTop();
- for (var i = top; i < cursor.row; i++) {
+ for (var i = 0; i < cursor.row; i++) {
this.setAbsoluteCursorPosition(i, 0);
this.screen_.clearCursorRow();
}
@@ -1301,7 +1300,7 @@
/**
* Erase all characters from the current cursor position to the end of the
- * scroll region.
+ * screen, regardless of scroll region.
*
* The cursor position is unchanged.
*
@@ -1313,7 +1312,7 @@
this.eraseToRight();
- var bottom = this.getVTScrollBottom();
+ var bottom = this.screenSize.height - 1;
for (var i = cursor.row + 1; i <= bottom; i++) {
this.setAbsoluteCursorPosition(i, 0);
this.screen_.clearCursorRow();