don't put a command on history if it's the same command as last one

This commit is contained in:
Val Erastov 2016-11-24 02:43:05 -08:00
parent a44e6b3f41
commit 7bab2f0fa7

View file

@ -456,7 +456,9 @@ function Terminal(win, commandProcessor, variantsSupplier) {
if (command != null && command.trim().length != 0) {
var result = commandProcessor(command);
out.append($('<div>', {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());