Skip to content

[Feature]: Ghostty import should map theme (incl. light:/dark: pairs that follow system appearance) #22640

Closed

Description

@ZephyrDeng

Problem or use case

Import from Ghostty ignores the theme key, so for most Ghostty users no terminal colors are imported. Ghostty users usually get their colors from theme, not from inline palette/background/foreground keys.

It also can't express Ghostty's light/dark theme pair, which follows the system appearance:

theme = light:catppuccin-latte.conf,dark:catppuccin-mocha.conf

Orca already supports this model (theme: system + terminalThemeDark / terminalThemeLight / terminalUseSeparateLightTheme), but the import can't populate it.

Evidence (current main, src/main/ghostty/mapper.ts): FIELD_PARSERS has no theme entry, so the key falls into unsupportedKeys. Nothing resolves theme names against Ghostty's theme directories.

Orca 1.4.206, macOS.

Proposed solution

Map theme during Ghostty import:

  1. Parse both forms: theme = <name> and theme = light:<a>,dark:<b>. Ghostty also allows quoted values and a .conf suffix.
  2. If a name matches a built-in Orca terminal theme (case-insensitive, e.g. catppuccin-mocha → Catppuccin Mocha), set terminalThemeDark / terminalThemeLight. For the light/dark form, also set terminalUseSeparateLightTheme = true.
  3. Otherwise, resolve the theme file the way Ghostty does (user themes/ dirs next to the config, then Ghostty.app/Contents/Resources/ghostty/themes on macOS). Parse its palette/background/foreground/cursor-*/selection-* and import it as a custom terminal theme (terminalCustomThemes), per mode.
  4. Show the resolved theme(s) in the import preview.

Importing theme colors as per-mode themes, not into terminalColorOverrides, matters: overrides currently apply to both modes (#10561), so a dark palette imported as overrides breaks light mode.

Alternatives or additional context

Related: #15985 (the import picks the last font-family instead of the first, which is common when the second line is a CJK fallback), #18658, #10561, #11520.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions