Explorar o código

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 hai 7 meses
pai
achega
06c42e3eaf
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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"],