diff --git a/src/xterm.js b/src/xterm.js index 07b54b31..f9b9786f 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -239,6 +239,22 @@ } } + CompositionHelper.prototype.handleAnyTextareaChanges = function() { + var oldValue = this.textarea.value; + + var self = this; + setTimeout(function() { + // Ensure no composition has started since the timeout + if (!self.isComposing) { + var newValue = self.textarea.value; + var diff = newValue.replace(oldValue, ''); + if (diff.length > 0) { + self.terminal.handler(diff); + } + } + }, 0); + } + /** * Updates the composition view's position. */ @@ -2619,6 +2635,11 @@ } } + if (ev.keyCode === 229) { + this.compositionHelper.handleAnyTextareaChanges(); + return; + } + var self = this; var result = this.evaluateKeyEscapeSequence(ev);