Skip to content

feat(web): add a terminal line height setting - #1

Closed
wwwdata wants to merge 1 commit into
mainfrom
terminal-line-height
Closed

wwwdata wants to merge 1 commit into
mainfrom
terminal-line-height

Conversation

@wwwdata

@wwwdata wwwdata commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Problem

Since the terminal moved to the libghostty canvas renderer (pingdotgg#4860), each row is round(fontSize * 1.35) tall. That is looser than Ghostty at the same font and size, and there is no control for it. Before that renderer, pingdotgg#3096 set xterm.js lineHeight to 1 so row gaps would not break QR codes (pingdotgg#336).

Change

Settings → Appearance → Terminal line height is a multiplier from 1 to 2. The default is 1.35, so current terminals stay as they are. Row height is max(round(fontSize × multiplier), ceil(glyphHeight)), so a row never shrinks below the measured glyph. Changing it reflows the open terminal the same way font size does. Web and desktop share the client setting. Mobile keeps its own terminal text settings.

The settings preview and the provider sign-in terminal use the same pitch. Restore defaults includes the new field.

Scope and approval

This is a configuration option for the existing terminal. The capability is the integrated terminal's row pitch, previously fixed at 1.35 after pingdotgg#4860 and previously set to 1 for xterm.js in pingdotgg#3096. The option only changes that multiplier. The default is unchanged, and it does not add a workflow. Discussion: pingdotgg#26988.

Verification

Focused tests cover the default and decode bounds, cell height at 1, 1.2, 1.35, and 2, clamping below the glyph and outside 1–2, grid row count, and live surface reflow.

vp test run packages/contracts/src/settings.test.ts apps/web/src/terminal/ghostty/renderer.test.ts apps/web/src/components/settings/SettingsPanels.logic.test.ts — 3 files, 35 passed.

vp test run apps/web/src/terminal/ghostty/surface.test.ts -t "reflows row height" — 1 passed.

vp run check:changed — format, lint, knip, typecheck (32 packages), tests (8 files, 91 passed), and React compiler passed.

Manual check in the web app, DejaVu Sans Mono at 13px (Menlo is not installed on this machine). The same terminal session ran bash /tmp/qr-line-height.sh, which prints a digit/M/i ruler and qrencode -t ansiutf8 of pingdotgg#26988. The ruler columns line up. The QR is intact at 1.35, 1.20, and 1.00. At 1.35 and 1.20 the rows are separated and the code does not scan. At 1.00 the rows meet, and the code scans back to that discussion URL.

Settings, DejaVu Sans Mono 13px, line height 1.35:

Terminal line height setting at 1.35 with DejaVu Sans Mono 13px

Terminal at 1.35 (default):

Terminal at line height 1.35 with a QR code in DejaVu Sans Mono

Terminal at 1.20:

Terminal at line height 1.20 with a QR code in DejaVu Sans Mono

Terminal at 1.00:

Terminal at line height 1.00 with a QR code in DejaVu Sans Mono

Not checked: the Ghostty app side by side, the Electron window (the web UI it wraps was checked), and mobile, which does not use this setting.

Grok 4.7 via Cursor

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

The Ghostty canvas renderer sizes rows at fontSize * 1.35, which looks
looser than Ghostty and cannot be changed. Add a client setting that
defaults to 1.35, multiplies the font size for row height, and never
shrinks a row below the measured glyph.

Grok 4.7 via Cursor

Co-authored-by: Ben Bieker <ben@bieker.ninja>
@wwwdata wwwdata closed this Oct 29, 2026
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.

2 participants