Merge pull request #5425 from xtermjs/anthonykim1/parsingDataCharCode

Only show char codes for parsing data on trace
This commit is contained in:
Daniel Imms
2025-10-22 19:08:47 -07:00
committed by GitHub
+6 -3
View File
@@ -445,7 +445,10 @@ export class InputHandler extends Disposable implements IInputHandler {
// Log debug data, the log level gate is to prevent extra work in this hot path // Log debug data, the log level gate is to prevent extra work in this hot path
if (this._logService.logLevel <= LogLevelEnum.DEBUG) { if (this._logService.logLevel <= LogLevelEnum.DEBUG) {
this._logService.debug(`parsing data${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`, typeof data === 'string' this._logService.debug(`parsing data ${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`);
}
if (this._logService.logLevel === LogLevelEnum.TRACE) {
this._logService.trace(`parsing data (codes)`, typeof data === 'string'
? data.split('').map(e => e.charCodeAt(0)) ? data.split('').map(e => e.charCodeAt(0))
: data : data
); );
@@ -606,7 +609,7 @@ export class InputHandler extends Disposable implements IInputHandler {
// since an empty cell is only set by fullwidth chars // since an empty cell is only set by fullwidth chars
bufferRow.addCodepointToCell(this._activeBuffer.x - offset, bufferRow.addCodepointToCell(this._activeBuffer.x - offset,
code, chWidth); code, chWidth);
for (let delta = chWidth - oldWidth; --delta >= 0; ) { for (let delta = chWidth - oldWidth; --delta >= 0;) {
bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr); bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr);
} }
continue; continue;
@@ -1622,7 +1625,7 @@ export class InputHandler extends Disposable implements IInputHandler {
const text = bufferRow.getString(x); const text = bufferRow.getString(x);
const data = new Uint32Array(text.length * length); const data = new Uint32Array(text.length * length);
let idata = 0; let idata = 0;
for (let itext = 0; itext < text.length; ) { for (let itext = 0; itext < text.length;) {
const ch = text.codePointAt(itext) || 0; const ch = text.codePointAt(itext) || 0;
data[idata++] = ch; data[idata++] = ch;
itext += ch > 0xffff ? 2 : 1; itext += ch > 0xffff ? 2 : 1;