Skip to content

Commit 4d06787

Browse files
author
saravmajestic
committed
chore: add altimate_change markers to upstream patches
1 parent 92bffb7 commit 4d06787

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/opencode/src/cli/cmd/tui/app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
165165

166166
timeout = setTimeout(() => {
167167
cleanup()
168-
// Fallback: check COLORFGBG env var (set by many terminals) before defaulting to dark
168+
// altimate_change start — fix: COLORFGBG fallback for light terminal detection
169169
const colorfgbg = process.env.COLORFGBG
170170
if (colorfgbg) {
171171
const parts = colorfgbg.split(";")
@@ -176,6 +176,7 @@ async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
176176
}
177177
}
178178
resolve("dark")
179+
// altimate_change end
179180
}, 1000)
180181
})
181182
}

packages/opencode/src/cli/cmd/tui/context/theme.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,10 @@ function generateSystem(colors: TerminalColors, mode: "dark" | "light"): ThemeJs
433433
const transparent = RGBA.fromInts(0, 0, 0, 0)
434434
const isDark = mode == "dark"
435435

436-
// palette[7] (#c0c0c0) is invisible on light backgrounds — use dark fallback instead
436+
// altimate_change start — fix: light-mode foreground fallback
437437
const fgFallback = isDark ? colors.palette[7]! : "#1a1a1a"
438438
const fg = RGBA.fromHex(colors.defaultForeground ?? fgFallback)
439+
// altimate_change end
439440

440441
const col = (i: number) => {
441442
const value = colors.palette[i]
@@ -951,8 +952,9 @@ function getSyntaxRules(theme: Theme) {
951952
scope: ["markup.raw.inline"],
952953
style: {
953954
foreground: theme.markdownCode,
954-
// backgroundElement (not background) ensures contrast when background is transparent
955+
// altimate_change start — fix: inline code contrast on transparent backgrounds
955956
background: theme.backgroundElement,
957+
// altimate_change end
956958
},
957959
},
958960
{

0 commit comments

Comments
 (0)