From 852dac4d62c72f84eade983854f805a6493b58ba Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 17 Sep 2016 03:59:42 -0700 Subject: [PATCH] Don't clear prompt on clear if it already is --- src/xterm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index 79c11d10..64143dcb 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -3058,6 +3058,10 @@ Terminal.prototype.eraseLeft = function(x, y) { * Clears the entire buffer, making the prompt line the new first line. */ Terminal.prototype.clear = function() { + if (this.ybase === 0 && this.y === 0) { + // Don't clear if it's already clear + return; + } this.ydisp = 0; this.ybase = 0; this.y = 0;