Add lineHeight to ITerminalOptions
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start with ITerminalOptions, CanvasRenderer.measureFont(), charHeight, and remeasureFont() named in the issue. Read xterm.js 6.0’s lineHeight behavior and coordinate with the open issues #207, #146, and #126 because they touch related font metrics. Done means lineHeight is a runtime option with the stated default and multiplier behavior, glyphs remain centered, and the related metric changes are accounted for.
索引モデルが issue の本文から書いたものです。
説明
What's missing
There's no way to adjust line spacing. lineHeight appears nowhere in the published bundle, and the cell height is fixed by CanvasRenderer.measureFont():
const m = ctx.measureText("M"),
ascent = m.actualBoundingBoxAscent || this.fontSize * 0.8,
descent = m.actualBoundingBoxDescent || this.fontSize * 0.2,
height = Math.ceil(ascent + descent) + 2, // the only leading, hardcoded
baseline = Math.ceil(ascent) + 1;
charHeight returns metrics.height, and ITerminalOptions exposes fontSize and fontFamily but nothing for spacing — so there's no public knob and nothing private to reach for either.
Why
@xterm/xterm 6.0 has lineHeight?: number (xterm.d.ts:150), and xterm.js API compatibility is an explicit goal here — so this reads as a gap in that compatibility rather than a new feature. It's also the setting people reach for immediately after fontSize: we added runtime font-size controls, went to add line spacing beside them, and found it unavailable at any level.
Suggested shape
Matching xterm.js so existing code ports unchanged:
interface ITerminalOptions {
lineHeight?: number; // multiplier of measured line height, default 1.0
}
Feeding the same expression — roughly height = Math.ceil((ascent + descent) * lineHeight) + 2 — with the baseline offset by half the added leading so glyphs stay centred in the taller cell (xterm.js does this), and picked up by remeasureFont() so it works as a runtime option change like fontSize already does.
Relationship to open issues
This touches the same function as several open issues and should be built on whatever they settle rather than in parallel:
- #207 —
Math.ceil→Math.roundon the cell width - #146 — rounding metrics to device-pixel boundaries, including the height expression
- #126 — the visible gap between
──box-drawing cells; the hardcoded+ 2vertical leading looks like part of that story, and anything that changes it interacts with alineHeightmultiplier
Environment
ghostty-web0.4.0-next.21.g640db46(npmnext, published 2026-10-28,
commit640db46), and0.4.0(npmlatest) —ITerminalOptionsand
CanvasRenderer.measureFont()are identical in both, andlineHeight
appears in neither the typings nor the bundle.- Canvas renderer,
FitAddon, Vite + TypeScript
- 主要言語
- TypeScript
- スター
- 3.1k
- フォーク
- 202
- 平均マージ
- 1日 40分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/ghostty-web のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
coder/ghostty-web#207 ·
-
buffer translateToString()/getChars() return '' for empty cells, collapsing cursor-positioned textオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
coder/ghostty-web#205 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
coder/ghostty-web#204 ·
-
Alt+<printable key> sends the bare key with no ESC prefix (readline/emacs/tmux meta bindings lost)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#199 ·
coder/ghostty-web の issue をすべて見る
似ている issue
-
automated-triage type/bug type/ci
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Translate the READMEオープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
asasemahmed/openboard#68 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceオープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100