Skip to content

Commit 92bffb7

Browse files
author
saravmajestic
committed
chore: clean up verbose comments in fix
1 parent d018990 commit 92bffb7

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

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

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

166166
timeout = setTimeout(() => {
167167
cleanup()
168-
// altimate_change start — fix: use COLORFGBG env var as fallback before defaulting to dark
169-
// Many terminals (iTerm2, xterm, etc.) set COLORFGBG=<fg>;<bg> to indicate color scheme.
170-
// When bg component >= 8, the terminal likely has a light background.
168+
// Fallback: check COLORFGBG env var (set by many terminals) before defaulting to dark
171169
const colorfgbg = process.env.COLORFGBG
172170
if (colorfgbg) {
173171
const parts = colorfgbg.split(";")
@@ -178,7 +176,6 @@ async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
178176
}
179177
}
180178
resolve("dark")
181-
// altimate_change end
182179
}, 1000)
183180
})
184181
}

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

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

436-
// altimate_change start — fix: use contrast-appropriate fallback for light terminals
437-
// palette[7] is #c0c0c0 (light gray) which is invisible on white backgrounds
436+
// palette[7] (#c0c0c0) is invisible on light backgrounds — use dark fallback instead
438437
const fgFallback = isDark ? colors.palette[7]! : "#1a1a1a"
439438
const fg = RGBA.fromHex(colors.defaultForeground ?? fgFallback)
440-
// altimate_change end
441439

442440
const col = (i: number) => {
443441
const value = colors.palette[i]
@@ -953,10 +951,8 @@ function getSyntaxRules(theme: Theme) {
953951
scope: ["markup.raw.inline"],
954952
style: {
955953
foreground: theme.markdownCode,
956-
// altimate_change start — fix: use backgroundElement for inline code contrast on light themes
957-
// theme.background can be transparent, leaving inline code with no contrast protection
954+
// backgroundElement (not background) ensures contrast when background is transparent
958955
background: theme.backgroundElement,
959-
// altimate_change end
960956
},
961957
},
962958
{

0 commit comments

Comments
 (0)