Slight rebalancing. Added kill() and killall() commands

This commit is contained in:
Daniel Xie
2017-06-05 20:34:00 -05:00
parent f7018f082c
commit d3fa9f8c6e
5 changed files with 81 additions and 11 deletions
+7 -4
View File
@@ -412,11 +412,14 @@ var Terminal = {
//Replace all extra whitespace in command with a single space
command = command.replace(/\s\s+/g, ' ');
Terminal.commandHistory.push(command);
if (Terminal.commandHistory.length > 50) {
Terminal.commandHistory.splice(0, 1);
if (Terminal.commandHistory[Terminal.commandHistory.length-1] != command) {
Terminal.commandHistory.push(command);
if (Terminal.commandHistory.length > 50) {
Terminal.commandHistory.splice(0, 1);
}
Terminal.commandHistoryIndex = Terminal.commandHistory.length;
}
Terminal.commandHistoryIndex = Terminal.commandHistory.length;
//Process any aliases
command = substituteAliases(command);