From d30875483d026d870f786a7bc4b424b75fc92adf Mon Sep 17 00:00:00 2001 From: LukeGus Date: Wed, 30 Sep 2026 11:58:35 -0500 Subject: [PATCH] fix: readable terminal selection with the light theme (#1319) --- .../src/frontend/look/terminal-theme.ts | 5 ++++- .../frontend/look/terminal-theme.test.ts | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 plugins/ssh-terminal/tests/frontend/look/terminal-theme.test.ts diff --git a/plugins/ssh-terminal/src/frontend/look/terminal-theme.ts b/plugins/ssh-terminal/src/frontend/look/terminal-theme.ts index b335e506a..0751017e0 100644 --- a/plugins/ssh-terminal/src/frontend/look/terminal-theme.ts +++ b/plugins/ssh-terminal/src/frontend/look/terminal-theme.ts @@ -41,7 +41,10 @@ export function resolveTermixThemeColors( } const uiColors = TERMIX_DEFAULT_COLORS[resolvedUiTheme] ?? TERMIX_DEFAULT_COLORS.dark; - const base = TERMINAL_THEMES.termixDark.colors; + const base = + resolvedUiTheme === "light" + ? TERMINAL_THEMES.termixLight.colors + : TERMINAL_THEMES.termixDark.colors; return { ...base, background: uiColors.background, diff --git a/plugins/ssh-terminal/tests/frontend/look/terminal-theme.test.ts b/plugins/ssh-terminal/tests/frontend/look/terminal-theme.test.ts new file mode 100644 index 000000000..07e55c3e3 --- /dev/null +++ b/plugins/ssh-terminal/tests/frontend/look/terminal-theme.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "vitest"; +import { resolveTermixThemeColors } from "../../../src/frontend/look/terminal-theme"; +import { TERMINAL_THEMES } from "../../../src/frontend/look/terminal-themes"; + +describe("resolveTermixThemeColors", () => { + it("uses the light selection color with the light UI theme", () => { + const colors = resolveTermixThemeColors("termix", "light"); + expect(colors.background).toBe("#ffffff"); + expect(colors.selectionBackground).toBe( + TERMINAL_THEMES.termixLight.colors.selectionBackground, + ); + }); + + it("keeps the dark selection color with dark UI themes", () => { + const colors = resolveTermixThemeColors("termix", "dracula"); + expect(colors.background).toBe("#282a36"); + expect(colors.selectionBackground).toBe( + TERMINAL_THEMES.termixDark.colors.selectionBackground, + ); + }); +});