mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
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:
parent
7a9bc4ef6d
commit
bf21a028b9
8 changed files with 34 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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) ? (
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@ export type GlobalSettings = {
|
|||
terminalFontSize: number
|
||||
terminalFontFamily: string
|
||||
terminalFontWeight: number
|
||||
terminalLineHeight: number
|
||||
terminalCursorStyle: 'bar' | 'block' | 'underline'
|
||||
terminalCursorBlink: boolean
|
||||
terminalThemeDark: string
|
||||
|
|
|
|||
Loading…
Reference in a new issue