Clear textarea when ^C or enter is pressed

This commit is contained in:
Daniel Imms
2019-07-22 10:49:40 -07:00
parent 6a68a24739
commit c8a719b64a
+7
View File
@@ -1562,6 +1562,13 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
return true;
}
// If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers
// will announce deleted characters. This will not work 100% of the time but it should cover
// most scenarios.
if (result.key === C0.ETX || result.key === C0.CR) {
this.textarea.value = '';
}
this._keyDownHandled = true;
this._onKey.fire({ key: result.key, domEvent: event });
this.showCursor();