From e178139907a8a9a098a249849931faf89bdec5dc Mon Sep 17 00:00:00 2001 From: Nick Shaffner Date: Wed, 27 Feb 2019 22:37:22 -0800 Subject: [PATCH] Fix for issue #812: Xterm.js's encoding of mouse coordinate See: https://github.com/xtermjs/xterm.js/issues/812 Changed the utf-8 mouse encoding to match iTerm --- src/Terminal.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index c1fc8ec8..0539a904 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -854,16 +854,11 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II if (ch > 127) ch = 127; data.push(ch); } else { - if (ch === 2047) { - data.push(0); + if (ch > 2047) { + data.push(2047); return; - } - if (ch < 127) { - data.push(ch); } else { - if (ch > 2047) ch = 2047; - data.push(0xC0 | (ch >> 6)); - data.push(0x80 | (ch & 0x3F)); + data.push(ch); } } }