Stabilize OpenCode terminal rendering before release (#4850)

This commit is contained in:
Neil
2026-06-08 01:00:29 -07:00
committed by GitHub
parent 9867305465
commit f15dcd928c
43 changed files with 1549 additions and 455 deletions
+5
View File
@@ -22,6 +22,11 @@ describe('getDefaultSettings', () => {
expect(getDefaultSettings('/tmp').autoRenameBranchFromWorkDefaultedOn).toBe(true)
})
it('uses a block terminal cursor by default for new settings', () => {
expect(getDefaultSettings('/tmp').terminalCursorStyle).toBe('block')
expect(getDefaultSettings('/tmp').terminalCursorStyleDefaultedToBlock).toBe(true)
})
it('enables separate light terminal theme by default', () => {
expect(getDefaultSettings('/tmp').terminalUseSeparateLightTheme).toBe(true)
})
+2 -1
View File
@@ -200,7 +200,8 @@ export function getDefaultSettings(homedir: string): GlobalSettings {
// that lacks ligatures or if they've explicitly opted out. The resolver
// is in shared/terminal-ligatures.ts.
terminalLigatures: 'auto',
terminalCursorStyle: 'bar',
terminalCursorStyle: 'block',
terminalCursorStyleDefaultedToBlock: true,
terminalCursorBlink: true,
terminalThemeDark: 'Ghostty Default Style Dark',
terminalDividerColorDark: '#3f3f46',
@@ -0,0 +1,21 @@
import type { GlobalSettings } from './types'
type TerminalCursorStyleSettings = Pick<
GlobalSettings,
'terminalCursorStyle' | 'terminalCursorStyleDefaultedToBlock'
>
export function normalizeTerminalCursorStyleDefault(
settings: Partial<TerminalCursorStyleSettings> | undefined,
options: { preserveExplicitValue?: boolean } = {}
): TerminalCursorStyleSettings {
const defaultedToBlock =
settings?.terminalCursorStyleDefaultedToBlock === true || options.preserveExplicitValue === true
return {
// Why: prior builds persisted the old bar default into profiles; migrate
// those inherited values once while preserving later explicit choices.
terminalCursorStyle: defaultedToBlock ? (settings?.terminalCursorStyle ?? 'block') : 'block',
terminalCursorStyleDefaultedToBlock: true
}
}
+2
View File
@@ -2008,6 +2008,8 @@ export type GlobalSettings = {
* switches fonts, so "off" always stays off. */
terminalLigatures: 'auto' | 'on' | 'off'
terminalCursorStyle: 'bar' | 'block' | 'underline'
/** One-shot migration guard for moving inherited cursor defaults to block. */
terminalCursorStyleDefaultedToBlock?: boolean
terminalCursorBlink: boolean
terminalThemeDark: string
terminalDividerColorDark: string