Skip to content

feat(web): terminal line height setting and centred terminal text - #182

Merged
adampeterhiggins merged 1 commit into
mainfrom
ah/terminal-line-height
Oct 6, 2026
Merged

adampeterhiggins merged 1 commit into
mainfrom
ah/terminal-line-height

Conversation

@adampeterhiggins

Copy link
Copy Markdown
Owner

Terminal rows were fixed at 1.35× the font size, and text was vertically centred on the ink of "Mg". The descender pulled that box down, so text without descenders, like digits, capitals and most prompt segments, sat high in its row. Powerline prompts showed it clearly: about 2px above the text and 6px below, where Cursor and VS Code centre it.

  • Centred text: the renderer now centres the font's line box (fontBoundingBoxAscent/Descent) in the row, as xterm.js does. If the browser doesn't report those metrics, it falls back to the old ink-based centring.
  • Terminal line height setting: Settings → Appearance → Terminal line height, from 1.00 to 2.00 in steps of 0.05. It's stored as a whole percentage and defaults to 1.35, so the default row height doesn't change. Like CSS line-height, it's a multiple of the font size. VS Code's terminal.integrated.lineHeight multiplies the font's natural line height instead; the user guide notes the difference.

This is web and desktop. Mobile keeps its own terminal metrics. Docs updated: docs/user/appearance.md, docs/fork-differences.md.

Test: renderer.test.ts checks the row height for a given line height and that the font's line box is centred in the row.

🤖 Generated with Claude Code (Claude Opus 5.5)

Terminal rows were fixed at 1.35x the font size and text was centred on
the ink of "Mg", so text without descenders rode high in its row. Add a
Terminal line height setting (stored as a percentage, default 135 so rows
are unchanged) and centre the face's line box in the row, as xterm.js does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant