feat: add terminal line height setting (#712)

Add a configurable line height multiplier (1-3) to terminal appearance
settings under Typography, persisted and applied to all terminal panes.
This commit is contained in:
Kelvin Amoaba 2026-04-21 04:23:43 +00:00 committed by GitHub
parent 7a9bc4ef6d
commit bf21a028b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 1 deletions

View file

@ -42,6 +42,7 @@ function createSettings(overrides: Partial<GlobalSettings> = {}): GlobalSettings
terminalFontSize: 14,
terminalFontFamily: 'JetBrains Mono',
terminalFontWeight: 500,
terminalLineHeight: 1,
terminalCursorStyle: 'block',
terminalCursorBlink: false,
terminalThemeDark: 'orca-dark',

View file

@ -36,6 +36,7 @@ function createSettings(overrides: Partial<GlobalSettings> = {}): GlobalSettings
terminalFontSize: 14,
terminalFontFamily: 'JetBrains Mono',
terminalFontWeight: 500,
terminalLineHeight: 1,
terminalCursorStyle: 'block',
terminalCursorBlink: false,
terminalThemeDark: 'orca-dark',

View file

@ -171,6 +171,28 @@ export function TerminalPane({
}
/>
</SearchableSetting>
<SearchableSetting
title="Line Height"
description="Controls the terminal line height multiplier."
keywords={['terminal', 'typography', 'line height', 'spacing']}
>
<NumberField
label="Line Height"
description="Controls the terminal line height multiplier."
value={settings.terminalLineHeight}
defaultValue={1}
min={1}
max={3}
step={0.1}
suffix="1 to 3"
onChange={(value) =>
updateSettings({
terminalLineHeight: clampNumber(value, 1, 3)
})
}
/>
</SearchableSetting>
</section>
) : null,
matchesSettingsSearch(searchQuery, TERMINAL_CURSOR_SEARCH_ENTRIES) ? (

View file

@ -15,6 +15,11 @@ export const TERMINAL_TYPOGRAPHY_SEARCH_ENTRIES: SettingsSearchEntry[] = [
title: 'Font Weight',
description: 'Controls the terminal text font weight.',
keywords: ['terminal', 'typography', 'weight']
},
{
title: 'Line Height',
description: 'Controls the terminal line height multiplier.',
keywords: ['terminal', 'typography', 'line height', 'spacing']
}
]

View file

@ -36,6 +36,7 @@ export function applyTerminalAppearance(
pane.terminal.options.fontWeight = terminalFontWeights.fontWeight
pane.terminal.options.fontWeightBold = terminalFontWeights.fontWeightBold
pane.terminal.options.macOptionIsMeta = settings.terminalMacOptionAsAlt === 'true'
pane.terminal.options.lineHeight = settings.terminalLineHeight
try {
const state = captureScrollState(pane.terminal)
pane.fitAddon.fit()

View file

@ -433,7 +433,8 @@ export function useTerminalPaneLifecycle({
),
cursorStyle: currentSettings?.terminalCursorStyle ?? 'bar',
cursorBlink: currentSettings?.terminalCursorBlink ?? true,
macOptionIsMeta: currentSettings?.terminalMacOptionAsAlt === 'true'
macOptionIsMeta: currentSettings?.terminalMacOptionAsAlt === 'true',
lineHeight: currentSettings?.terminalLineHeight ?? 1
}
},
onLinkClick: (event, url) => {

View file

@ -104,6 +104,7 @@ export function getDefaultSettings(homedir: string): GlobalSettings {
terminalFontSize: 14,
terminalFontFamily: defaultTerminalFontFamily(),
terminalFontWeight: DEFAULT_TERMINAL_FONT_WEIGHT,
terminalLineHeight: 1,
terminalCursorStyle: 'bar',
terminalCursorBlink: true,
terminalThemeDark: 'Ghostty Default Style Dark',

View file

@ -575,6 +575,7 @@ export type GlobalSettings = {
terminalFontSize: number
terminalFontFamily: string
terminalFontWeight: number
terminalLineHeight: number
terminalCursorStyle: 'bar' | 'block' | 'underline'
terminalCursorBlink: boolean
terminalThemeDark: string