fix(run): pin the lane terminal font so Vietnamese glyphs never fall back
xterm left fontFamily unset, so it used the browser/OS default (courier-new/monospace). That face is missing Vietnamese precomposed diacritics on many systems, so the browser silently substitutes those glyphs from another face with a different advance width — corrupting the cell even under the canvas renderer, which only stops a glyph from shoving its neighbours, not from overflowing its own cell. Pin the terminal to the app's own bundled JetBrains Mono and import its vietnamese subset (previously only latin was loaded).
This commit is contained in:
@@ -26,7 +26,21 @@ export function TerminalView({ runId, wsBaseUrl }: TerminalViewProps) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const term = new Terminal({ convertEol: true, fontSize: 13, cursorBlink: true });
|
||||
// An explicit fontFamily pins every glyph to one bundled webfont. Left
|
||||
// unset, xterm falls back to the browser/OS default (`courier-new`),
|
||||
// which on Windows lacks Vietnamese precomposed diacritics — the OS then
|
||||
// substitutes those specific glyphs from a different face with a
|
||||
// mismatched advance width, corrupting the cell it's drawn into even
|
||||
// under the canvas renderer (which only stops a glyph from shoving its
|
||||
// *neighbours*, not from overflowing its own cell). JetBrains Mono is
|
||||
// already bundled for the rest of the UI; main.tsx additionally imports
|
||||
// its `vietnamese` subset so this covers the diacritics too.
|
||||
const term = new Terminal({
|
||||
convertEol: true,
|
||||
fontSize: 13,
|
||||
cursorBlink: true,
|
||||
fontFamily: '"JetBrains Mono", monospace',
|
||||
});
|
||||
const fit = new FitAddon();
|
||||
term.loadAddon(fit);
|
||||
if (containerRef.current) term.open(containerRef.current);
|
||||
|
||||
Reference in New Issue
Block a user