From 7bab2f0fa7a063feef9d37a5297d12760999a7b1 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Thu, 24 Nov 2016 02:43:05 -0800 Subject: [PATCH] don't put a command on history if it's the same command as last one --- web/app/ui/ui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/ui/ui.js b/web/app/ui/ui.js index 90e7867b..e27ce36b 100644 --- a/web/app/ui/ui.js +++ b/web/app/ui/ui.js @@ -456,7 +456,9 @@ function Terminal(win, commandProcessor, variantsSupplier) { if (command != null && command.trim().length != 0) { var result = commandProcessor(command); out.append($('
', {text: result, 'class': 'terminal-commandResult'})); - this.history.push(command); + if (this.history.length == 0 || command != this.history[this.history.length - 1]) { + this.history.push(command); + } this.historyPointer = this.history.length; } out.parent().scrollTop(out.height());