Explorar el 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 hace 7 meses
padre
commit
06c42e3eaf
Se han modificado 1 ficheros con 3 adiciones y 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";
       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 {
     try {
       const result = execSync("defaults read -g AppleInterfaceStyle", {
       const result = execSync("defaults read -g AppleInterfaceStyle", {
         encoding: "utf8", timeout: 500, stdio: ["pipe", "pipe", "pipe"],
         encoding: "utf8", timeout: 500, stdio: ["pipe", "pipe", "pipe"],