forked from tools/josh
1
0
Fork 0
This commit is contained in:
Florine W. Dekker 2019-02-09 14:37:36 +01:00
parent 45627727fe
commit a182f9b9d1
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
1 changed files with 12 additions and 0 deletions

View File

@ -113,6 +113,12 @@ class Terminal {
this._inputHistory.clear();
}
ignoreInput() {
this.outputText += `${this.prefixText}${this.inputText}\n`;
this.prefixText = this.generatePrefix();
this.inputText = "";
}
processInput(input) {
this.inputText = "";
@ -155,6 +161,12 @@ class Terminal {
this.inputText = this._inputHistory.nextEntry();
window.setTimeout(() => moveCaretToEndOf(this._input), 0);
break;
case "c":
if (e.ctrlKey) {
this.ignoreInput();
e.preventDefault();
}
break;
case "l":
if (e.ctrlKey) {
this.clear();