diff --git a/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx b/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx index eb77800dcb3..bb4e3f79397 100644 --- a/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx +++ b/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx @@ -1,4 +1,5 @@ import type { GlobalSettings } from '../../../../shared/types' +import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../../../../shared/constants' import { NumberField, SettingsSubsectionHeader } from './SettingsFormControls' import { SearchableSetting } from './SearchableSetting' import { clampNumber, resolvePaneStyleOptions } from '@/lib/terminal-theme' @@ -47,7 +48,7 @@ export function TerminalPaneAppearanceSection({ 'Dim unfocused panes.' )} value={paneStyleOptions.inactivePaneOpacity} - defaultValue={0.8} + defaultValue={DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY} min={0} max={1} step={0.05} diff --git a/src/shared/constants.test.ts b/src/shared/constants.test.ts index 88ea5c1282f..f6bd48c8fde 100644 --- a/src/shared/constants.test.ts +++ b/src/shared/constants.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' import { + DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY, getDefaultNotificationSettings, getDefaultPrimarySelectionMiddleClickPaste, getDefaultTerminalRightClickToPaste, @@ -45,6 +46,12 @@ describe('getDefaultSettings', () => { expect(getDefaultSettings('/tmp').terminalUseSeparateLightTheme).toBe(true) }) + it('keeps inactive terminal panes readable by default', () => { + expect(getDefaultSettings('/tmp').terminalInactivePaneOpacity).toBe( + DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY + ) + }) + it('asks before closing terminals with running processes by default', () => { expect(getDefaultSettings('/tmp').skipCloseTerminalWithRunningProcessConfirm).toBe(false) }) diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 541444f6d23..536663e1d6a 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -51,6 +51,7 @@ export const DEFAULT_APP_FONT_FAMILY = 'Geist' export const DEFAULT_SHOW_SLEEPING_WORKSPACES = true export const DEFAULT_HIDE_SLEEPING_WORKSPACES = false export const DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE: AgentActivityDisplayMode = 'compact' +export const DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY = 0.9 export function normalizeAgentActivityDisplayMode(value: unknown): AgentActivityDisplayMode { return value === 'full' || value === 'compact' ? value : DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE @@ -223,7 +224,7 @@ export function getDefaultSettings(homedir: string): GlobalSettings { terminalThemeLight: 'Builtin Tango Light', terminalCustomThemes: [], terminalDividerColorLight: '#d4d4d8', - terminalInactivePaneOpacity: 0.8, + terminalInactivePaneOpacity: DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY, terminalActivePaneOpacity: 1, terminalPaneOpacityTransitionMs: 140, terminalDividerThicknessPx: 3,