# Applying a user font to the DSH sidebar terminal (xterm.js DOM renderer) **Is the CSS-override approach valid?** Partially — but not as claimed. Injecting `.xterm-rows, .xterm-char-measure-element { font-family: !important }` *does* win the cascade against xterm's own injected rule and inline measure styles, so both the rendered rows and the measurement spans compute the new font (this is exactly the local observation). What it does **not** do is invalidate xterm's cached cell size or per-character width cache. The DOM renderer takes its font from an injected stylesheet built from `rawOptions.fontFamily`, while the `CharSizeService` re-measures **only** in response to option changes (`fontFamily`/`fontSize`), a real resize, a device-pixel-ratio change, or a hidden→visible transition. A pure CSS change fires none of those, so glyphs advance at the new font's width while `dimensions.css.cell.*`, cursor geometry, selection rectangles, row heights and default letter spacing stay at the old metrics — i.e. rendering and measurement diverge. The officially supported and universally used mechanism is the options API (`term.options.fontFamily = …`), which re-measures; the CSS override is only safe if it is paired with a forced re-measure. Chrome is also prototyping a privacy restriction that would limit CSS `font-family` to OS-default fonts, which is a long-term risk to any local-font approach. --- ## Primary-source findings The terminal plugin bundles **`@xterm/xterm` ^6.0.0** (devDependencies in `@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json`; the package itself is version `0.1.7-alpha.2`). Source citations below use the `6.0.0` tag where the bundled code matches it, and `master` to note where current xterm differs. ### 1. Where the DOM renderer takes its font-family - The DOM renderer defines `ROW_CONTAINER_CLASS = 'xterm-rows'` and adds it to the row container ([DomRenderer.ts @6.0.0 L21, L68](https://github.com/xtermjs/xterm.js/blob/6.0.0/src/browser/renderer/dom/DomRenderer.ts#L21-L68)). - **Yes, it is a stylesheet rule injected by `_injectCss()`.** That method creates a `