Procházet zdrojové kódy

fix(tui): only use macOS system appearance for Terminal.app

Other terminals (Ghostty, kitty, etc.) have their own theme
independent of macOS appearance. Only fall back to AppleInterfaceStyle
for Terminal.app. All other terminals default to dark when COLORFGBG
is not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fanghanjun před 7 měsíci
rodič
revize
06c42e3eaf
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      packages/cli/src/tui/theme.ts

+ 3 - 1
packages/cli/src/tui/theme.ts

@@ -19,7 +19,9 @@ function detectTerminalTheme(): TerminalTheme {
       return bg <= 6 || bg === 8 ? "dark" : "light";
     }
   }
-  if (process.platform === "darwin") {
+  // Only Terminal.app follows macOS system appearance; other terminals
+  // (Ghostty, kitty, etc.) have their own theme independent of the OS.
+  if (isAppleTerminal && process.platform === "darwin") {
     try {
       const result = execSync("defaults read -g AppleInterfaceStyle", {
         encoding: "utf8", timeout: 500, stdio: ["pipe", "pipe", "pipe"],