Files
Netcatty/infrastructure/shims/nodeDiagnosticsChannel.ts
T
陈大猫 bd8476fb34 fix(terminal): enable font ligatures from the terminal setting (#3557)
fontLigatures already defaulted to on, but the terminal never loaded
the ligatures addon, so Fira Code and Maple Mono kept drawing != as two
cells. Activate the addon after open and before WebGL, and rebuild the
WebGL atlas when the setting changes so glyphs are not rasterized
without the calt feature.

The addon bundles lru-cache's node:diagnostics_channel import. Alias
that builtin to a no-op channel in the Vite renderer build and in the
Electron live-test bundles.

Closes #3543
2026-09-29 17:34:00 +08:00

25 lines
564 B
TypeScript

// @xterm/addon-ligatures bundles lru-cache, which imports
// node:diagnostics_channel for optional metrics. The renderer has no Node
// builtins. Nothing subscribes, so publish and tracePromise stay unused.
const silentChannel = {
hasSubscribers: false,
publish() {},
};
export function channel(): typeof silentChannel {
return silentChannel;
}
export function tracingChannel(): {
hasSubscribers: boolean;
tracePromise: () => Promise<void>;
} {
return {
hasSubscribers: false,
tracePromise() {
return Promise.resolve();
},
};
}