Fixed writing composed characters (#2158)

Fixes #2140
This commit is contained in:
CHaBou 2017-09-03 18:06:12 +02:00 committed by Leo Lamprecht
parent 537e58ec10
commit a348185cc5

View file

@ -256,7 +256,9 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) {
];
if (!clearBlacklist.includes(e.code.toLowerCase()) &&
!clearBlacklist.includes(e.key.toLowerCase())) {
selection.clear(this.terminal);
// Since Electron 1.6.X, there is a race condition with character composition
// if this selection clearing is made synchronously. See #2140.
setTimeout(() => selection.clear(this.terminal), 0);
}
// If the `hyperCaret` was removed on `selectAll`, we need to insert it back