Skip to content

[BUG] Docker container terminal background is white instead of matching selected theme #780

@claw-io

Description

@claw-io

Bug Description

When opening a Docker container console terminal (via the Docker panel → container detail → Console tab), the terminal background color is white (#ffffff) regardless of the users selected app theme. This only affects the Docker console terminal — the regular SSH terminal correctly respects the theme.

This produces a jarring experience where the Docker terminal has a white background even when the rest of the app uses a dark or custom theme.

Steps to Reproduce

  1. Leave terminal theme at the default "termix" setting
  2. Set the app UI theme to something that isnt in the hardcoded dark list — e.g., "light", "system" (when in light mode), or any theme that was added after the ConsoleTerminal was written
  3. Navigate to Hosts → select a host with Docker enabled
  4. Go to the Docker containers tab → click into a running container
  5. Open the Console tab
  6. Click Connect
  7. Observe that the terminal background is white instead of matching the app theme

Note: The regular SSH terminal does not have this issue — it uses resolveTermixThemeColors() which has an extensible mapping of app themes to background colors. The docker consoles own isDarkMode check (lines 52–59) is a hardcoded list that drifts as new themes are added.

Expected Behavior

The Docker container terminal should use the same theme-aware background color as the regular SSH terminal.

Actual Behavior

The Docker console terminal always resolves to themeColors.background === "#ffffff" (from termixLight) for any app theme that isnt one of a small hardcoded list of dark modes ("dark", "dracula", "gentlemansChoice", "midnightEspresso", "catppuccinMocha").

Root Cause

The component at src/ui/features/docker/components/ConsoleTerminal.tsx (lines 52–71) uses a simple isDarkMode boolean to pick between termixDark and termixLight themes:

const isDarkMode =
  appTheme === "dark" ||
  appTheme === "dracula" ||
  appTheme === "gentlemansChoice" ||
  appTheme === "midnightEspresso" ||
  appTheme === "catppuccinMocha" ||
  (appTheme === "system" &&
    window.matchMedia("(prefers-color-scheme: dark)").matches);

const themeColors = React.useMemo(() => {
  const activeTheme = terminalConfig.theme;
  if (activeTheme === "termix") {
    return isDarkMode
      ? TERMINAL_THEMES.termixDark.colors   // #0c0d0b
      : TERMINAL_THEMES.termixLight.colors;  // #ffffff
  }
  return (
    TERMINAL_THEMES[activeTheme]?.colors ?? TERMINAL_THEMES.termixDark.colors
  );
}, [terminalConfig.theme, isDarkMode]);

The SSH terminal in Terminal.tsx already has the correct approach — it uses resolveTermixThemeColors() from src/ui/features/terminal/terminal-theme.ts, which maps the app theme through a rich lookup table (TERMIX_DEFAULT_COLORS) covering all themes (dark, light, dracula, catppuccin, nord, solarized, tokyo-night, one-dark, gruvbox).

Proposed Fix

Replace the isDarkMode + manual switch in ConsoleTerminal.tsx with a call to the shared resolveTermixThemeColors() function:

import { resolveTermixThemeColors } from "@/features/terminal/terminal-theme";

const themeColors = React.useMemo(() => {
  const activeTheme = terminalConfig.theme;
  return resolveTermixThemeColors(activeTheme, appTheme);
}, [terminalConfig.theme, appTheme]);

A reference fix is available at:
claw-io/Termix@e97854c

Environment

  • Version: v2.3.2
  • Commit: f0f3e0b
  • Browser: Any (Chromium, Firefox, WebKit)
  • Deployment: Docker / Self-hosted

Additional Context

The regular SSH terminal (src/ui/features/terminal/Terminal.tsx) handles theme resolution correctly via resolveTermixThemeColors(). The Docker console terminal (src/ui/features/docker/components/ConsoleTerminal.tsx) was implemented separately and duplicated the theme logic with an incomplete theme check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    Status
    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions