From 4ecc098de42dcb5f07e5d96696dccc6e70a5b727 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 27 Aug 2022 06:38:15 -0700 Subject: [PATCH] Get width of emoji/combined chars --- addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts b/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts index 5685012d..e1d56b78 100644 --- a/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts +++ b/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts @@ -438,9 +438,11 @@ export class WebglCharAtlas implements IDisposable { // underline colors to prevent important colors could get cleared. let enableClearThresholdCheck = !powerlineGlyph; - let chWidth: number = 1; - if (typeof codeOrChars === 'number' && (underline || strikethrough)) { + let chWidth: number; + if (typeof codeOrChars === 'number') { chWidth = this._unicodeService.wcwidth(codeOrChars); + } else { + chWidth = this._unicodeService.getStringCellWidth(codeOrChars); } // Draw underline