Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Themes, per-profile colours and +list-themes

Status: proposed. Date: 2026-11-29. Owner approved: no.

Ghostty's theme key and +list-themes action, implemented with Ghostty's meaning (ADR 0009, ADR 0010), plus two Windows Terminal schemes and per-profile colours (ADR 0013, "Seams left for later").

Sources read: Ghostty v1.4.0 (vendor/ghostty): src/config/Config.zig (theme, Theme.parseCLI, loadTheme, finalize), src/config/theme.zig (open, LocationIterator), src/cli/list_themes.zig, src/cli/args.zig (parseAutoStruct), src/os/homedir.zig (expandHome).

The theme key

Exactly Ghostty's syntax and lookup:

  • A value is a theme name or an absolute path. A value containing ,, = or a : that is not a drive letter's (index 1) is a light/dark pair, light:NAME,dark:NAME: whitespace around keys and values is trimmed, order does not matter, a quoted value is unquoted, both must be present and nothing else may be. Anything else is an invalid value. An empty value resets to the default, no theme, as for every Ghostty key.
  • An absolute path (C:\…, \\server\…) loads that file; nothing else is searched. Voyager7 also expands ~\ and ~/ from %USERPROFILE% as its config-file already does (Ghostty does not expand ~ on Windows; this only accepts more).
  • A name with \ or / that is not absolute is an error: "theme "X" cannot include path separators unless it is an absolute path".
  • A name is looked up first in the user's themes folder, then in the built-in collection. The themes folder is Ghostty's $XDG_CONFIG_HOME/ghostty/themes on Windows: %APPDATA%\Voyager7\themes, or themes beside the file --config names (the rule profiles already follows, ADR 0013). A file there wins over a built-in theme of the same name. Names compare as the Windows file system does (without regard to case); the built-in collection matches exactly first, then without regard to case, so it behaves the same as a folder of files would.
  • Not found: one diagnostic per place tried, as Ghostty words them (theme "X" not found, tried path "…\themes\X", then … not in the built-in collection). Like every Ghostty diagnostic it is reported, not fatal: the rest of the configuration applies.

What a theme file may set, and the override rule

A theme file is a Ghostty configuration file. As in Ghostty it may set any key except theme and config-file, which are silently ignored in a theme. The bundled themes set only colours. Ghostty loads the theme first and then replays the whole configuration over it, so every key the configuration sets wins over the theme wherever it appears in the file: background = before or after theme = both override the theme's background. Voyager7 does the same by placing the theme file's entries before all of the main configuration's entries.

Light and dark

The pair follows Windows' app mode ("Choose your default app mode", AppsUseLightTheme, Windows 10 1809 and later). Windows 7 and older Windows 10 builds have no app mode, so they are light, the same rule window-theme = system uses. When the mode changes (WM_SETTINGCHANGE "ImmersiveColorSet"), Voyager7 reloads the configuration with the other side of the pair, as Ghostty replays its configuration on a colour-scheme change, and every open terminal takes its new colours without a "configuration reloaded" notice. As in Ghostty, a pair with two different names turns window-theme = auto into system.

The built-in collection

  • Ghostty's set, pinned to v1.4.0: Ghostty v1.4.0's build.zig.zon pins iterm2_themes to ghostty-themes-release-20261019-151001-86a776d.tgz (zig hash N-V-__8AAJ3vBQAq1fLMh5J8uWLkeDLS6WAdR2x5KcrmEyz6, verified with zig fetch; SHA-256 ab2513e316372c45c9f86e3e511aebdbfa6c39fa03c210096b19152fe288505b), the release-20261019-151001-86a776d release of mbadolato/iTerm2-Color-Schemes in Ghostty's theme-file format: 819 themes. (Ghostty's main branch has since moved to a later release; we follow the tagged v1.4.0.)
  • Three Windows Terminal schemes: "Campbell", "Campbell Powershell" and "Vintage" (Vintage added 2026-11-30 at the owner's request; no other WT schemes), values copied from Windows Terminal v1.25.3131.0 src/cascadia/TerminalSettingsModel/defaults.json (SHA-256 5abe4fef…c5c41), written in Ghostty's format with only the keys WT sets: palette 0–15, background, foreground, cursor-color. Ghostty's set has no theme with these names. 822 themes in all.
  • Licences: the iTerm2-Color-Schemes collection is MIT (Copyright 2011 to present Mark Badolato); its licence adds that "the copyright/license for each individual theme belongs to the author of that theme". Ghostty redistributes the same files on that basis and so do we; the notice (verbatim, including that sentence) is in licenses/Third-party.txt. Windows Terminal is MIT, Copyright (c) Microsoft Corporation; its notice is there too. Theme data is data, not code: no other program's code is used.
  • Storage: cargo xtask themes downloads the pinned archive and defaults.json (SHA-256 checked) and packs every theme into crates/v7-core/data/themes.v7t.z: a name list, then per theme a bit mask of the 22 colour slots it sets and their RGB bytes, zlib-compressed. Every bundled file sets exactly palette 0–15, background, foreground, cursor-color, cursor-text, selection-background and selection-foreground as #rrggbb; the packer refuses anything else, so the packing is lossless. --check proves the checked-in table matches the sources. A theme is unpacked back into Ghostty's theme-file text when it is used, so it goes through the same parser as a user's file.
  • Embedded everywhere: the packed table is 46,845 bytes (the text files are 400,610 bytes; the Ghostty .tgz is 109,286). Under the ~60 KB the owner set for embedding, so it is compiled into voyager7.exe in every package (Setup, ZIP, standalone-full, standalone-min): no Setup component, no sidecar file, and +list-themes and theme = behave the same in every package. Measured numbers are in the report.

+list-themes

Ghostty's action, flags and output:

  • --plain, --path, --color=all|dark|light, --help. Plain output is NAME (user|resources), with --path followed by the path, sorted without regard to case; --color keeps themes whose background's luminance (0.2126 R + 0.7152 G + 0.0722 B) is below (dark) or at least (light) one half. A built-in theme has no file, so its path is printed as (built in).
  • Interactive preview when standard output is a console and --plain is not given: the searchable list (32 columns) with Ghostty's live preview of the selected theme (name, palette swatches, the bat sample and prompt, styled lorem ipsum), its help window (F1, ?), search (/), filter cycle (f), hex/decimal palette numbers (h, x, d), navigation (arrows, j/k, +/-, PgUp/PgDn, ^U/^D, Home/End, g/G, mouse wheel and click), copy name (c) or path (C) to the clipboard, and the save window (Enter) whose w writes auto\theme.ghostty beside the main configuration with theme = NAME, as Ghostty's does. Texts say "Voyager7 configuration" where Ghostty says "Ghostty configuration".
  • Consoles: the preview draws a cell grid. With virtual terminal output (Windows 10 conhost, Windows Terminal, inside Voyager7) it writes 24-bit colour SGR in the alternate screen. Without it (Windows 7 conhost) it uses the console API: a private screen buffer, WriteConsoleOutputW, and a 16-entry colour table chosen per frame from the colours on screen (the theme's background, foreground and 16 palette colours first, then the rest mapped to the nearest), set with SetConsoleScreenBufferInfoEx; the original table, mode, title and screen are restored on exit, Ctrl+C included. Keys and the mouse come from ReadConsoleInputW in both modes. Clipboard copies use the Windows clipboard, not OSC 52.
  • UI colours (2026-11-29): Ghostty paints its list, help, search and save windows black on white, or white on black once the terminal reports a dark scheme (mode 2031). Voyager7 draws them in the terminal's own default colours (SGR 39 and 49; in a 16-colour console, the console's own attribute and table entries, kept out of the per-frame table), so the list always matches the console it runs in. The selected row is Ghostty's (❯ name ❮, #00aa00 on #333333 dark or #aaaaaa light, hover #222222 or #bbbbbb), and dark or light comes from the console's default background in its colour table, else Windows' app mode. In 16 colours the selected row's background keeps its own slot. A colour that would sit unchanged in its own slot is nudged one step, because the Windows 7 scraper reads a slot equal to the console's startup table as "the terminal's palette".
  • Title: "🛰️ Voyager7 Theme Preview 🛰️" (Ghostty's is "👻 Ghostty Theme Preview 👻"; the satellite is for the Voyager probe), and the console's own title back on exit. Windows 7 and 8 draw a box for an emoji outside the Basic Multilingual Plane in text Windows draws itself (the caption, conhost's title bar, the taskbar), so there the native title drops such emoji, as it drops the bell mark, and +list-themes in a plain Windows 7 console sets "Voyager7 Theme Preview"; Voyager7's tab strip keeps the satellites.
  • Resizing (Windows 7 console): the private buffer is as large as the shell's, so the window shrinks and grows back within it as the shell's did; the grid is drawn where the window is.

Per-profile colours (ADR 0013)

theme and the colour keys become profile-scoped: background, foreground, palette, cursor-color, cursor-text, selection-foreground, selection-background, the four search-* colours, and Ghostty's bold-color, minimum-contrast, palette-generate, palette-harmonious and faint-opacity (the last five are accepted in a profile and, as in the main file, reported "not supported yet" until Voyager7 implements them). Font keys and every other appearance key stay application-wide and are still reported in a profile file.

A Surface started from a profile uses, in order:

  1. Ghostty's defaults;
  2. the main configuration's theme, then its colour keys (Ghostty's rule above);
  3. the profile's built-in default theme, when it has one (below);
  4. the profile file's theme, then its colour keys. An empty theme = in the profile file drops the main configuration's theme (step 2 keeps only its colour keys) and the built-in default.

So a profile's theme replaces the main configuration's colours for that profile's tabs and splits, and the profile file's own colour keys tweak its theme. This is the one place where a profile file is not exactly "one more config-file loaded last" (ADR 0013): in Ghostty, an earlier explicit background in the main file would win over a theme set later, which would make a profile's theme useless whenever the main file sets a colour. Within each file Ghostty's rule holds.

Other tabs keep theirs. The window around the terminals (tab strip, window-theme = auto, split dividers, the window background before the first frame) follows the main configuration, as Ghostty's window chrome follows the window's configuration. On a reload and on a light/dark change every Surface re-reads its profile's colours.

The built-in default: PowerShell before 7 in Campbell Powershell

Like Windows Terminal's Windows PowerShell profile, a detected profile that runs PowerShell older than 7 has theme = Campbell Powershell by default (owner decision 2026-11-29). That is:

  • Windows PowerShell, powershell.exe, of any version (2.0 on a stock Windows 7, 3.0, 4.0, 5.0, 5.1): every Windows PowerShell is older than 7;
  • PowerShell Core 6.x, pwsh.exe. Its version comes from what detection already knows, without starting it: the PowerShell\<version> folder of an MSI install (6, 6.2.7, 6-preview), else the major version in the exe's file version resource. A pwsh.exe whose version cannot be read (a Store app alias, the .NET global tool or Scoop shim, which in practice install 7 or later) counts as 7 or later.

PowerShell 7 and later keep Ghostty's colours. The decision follows the profile's command as it is after its profile file is applied, and only detected profiles get it: a profile file that is not a detected profile (or Ghostty's command) never gets a built-in theme.

The default applies only when all of these hold:

  • that profile is not the default profile (v7-default-profile, or the fallback, which is Command Prompt or command's profile). The default profile always keeps Ghostty's default colours, like every other profile;
  • the main configuration (files, includes, CLI) sets neither theme nor any profile-scoped colour key: then the user's choice applies everywhere;
  • the profile's own file (profiles\Windows PowerShell.ghostty, …) sets neither theme nor any colour key: then the file's choice applies.

Every other profile (Command Prompt, PowerShell 7 and later, Git Bash, Nushell, MSYS2, Cygwin, WSL, profile files) uses Ghostty's default colours. So on Windows 7, where Command Prompt is the default, a cmd tab is in Ghostty's colours and a Windows PowerShell tab in Campbell Powershell. Without user configuration the default profile is Command Prompt on every Windows version (the fallback above), Windows 10 included.

Alternatives considered

  • A Setup component and sidecar file, only Campbell embedded in standalone-min: smaller standalone-min by about 46 KB, but theme = Dracula would work in one package and not another, and both +list-themes and the theme error would need a "not installed" branch. Rejected because the measured cost is under the owner's threshold.
  • Shipping the 821 text files: 400 KB on disk and 821 files to install; no gain over unpacking on use.
  • Literal Ghostty layering for profiles (main explicit colours beat a profile's theme): rejected above.
  • Profile appearance only through palette/background keys, no theme: rejected; the owner asked for themes per profile.

Consequences

  • Any Ghostty theme = line works unchanged, with the same 819 names and the same precedence; +list-themes exists.
  • voyager7.exe grows by the packed table and the preview code (numbers in the report).
  • Tabs of PowerShell before 7 change colour for users without colour settings; setting theme or any colour key, a colour in that profile's file, or making that profile the default turns it off.
  • A theme picker in the Settings window is later work; the Settings editor shows theme as a text value until then.