diff --git a/lib/interfaces.ts b/lib/interfaces.ts index 7da9331..3adf3b9 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -13,6 +13,14 @@ export interface ITerminalOptions { scrollback?: number; // Default: 1000 fontSize?: number; // Default: 15 fontFamily?: string; // Default: 'monospace' + /** + * Device pixel ratio for the canvas backing store. Defaults to + * window.devicePixelRatio. Pin to an integer (e.g. + * Math.round(window.devicePixelRatio)) to avoid sub-pixel seams between + * cells on fractional-DPR displays (Windows 125/150/175% scaling, some + * Linux setups). + */ + devicePixelRatio?: number; allowTransparency?: boolean; // Phase 1 additions diff --git a/lib/terminal.ts b/lib/terminal.ts index a0c9779..8fe9128 100644 --- a/lib/terminal.ts +++ b/lib/terminal.ts @@ -404,6 +404,7 @@ export class Terminal extends TerminalCore { cursorStyle: this.options.cursorStyle, cursorBlink: this.options.cursorBlink, theme: this.options.theme, + devicePixelRatio: this.options.devicePixelRatio, }); this.renderer.resize(this.cols, this.rows);