Themes and fonts
Picking a theme
Twelve themes are compiled into zterm. Open the settings editor with ⌘, (Ctrl+, on Linux and Windows), choose Set theme, and pick one. That writes theme into your settings file, so it survives a restart.
| dark | light | |
|---|---|---|
| zterm's own | dark |
light |
| GitHub | github-dark |
github-light |
| Solarized | solarized-dark |
solarized-light |
| Catppuccin | catppuccin-mocha |
catppuccin-latte |
| Gruvbox | gruvbox-dark |
gruvbox-light |
| Atom's One | one-dark |
one-light |
The palette lists them by name, Solarized Dark and Catppuccin Mocha, and the file spells them as above. Either spelling finds the row, so a name copied out of a config file works in the palette.
A theme reaches the chrome and the panes. It colours the tab bar, the palette and the splash, and it sets the sixteen colours a pane's contents fall back to when a program chooses none. A program that does choose a colour gets the colour it asked for in every theme.
The themes named after a vendor carry that vendor's accent on the active tab's underline, its index digit and the cursor. zterm's own two carry the Zestful orange.
Text too close to its background
Some themes have a colour that is the same as their background, or nearly. Text in that colour would be invisible, so zterm lightens it on a dark background, or darkens it on a light one, until it reaches a contrast ratio of 1.5. That is enough to see the text, but it stays faint. The background is never changed.
minimum_contrast sets that ratio, from 1.0 to 21.0. 1.0 turns it off, and a higher number makes more text easier to read but changes more of a theme's colours.
zterm can't tell a theme's colour from one a program chose, so it adjusts both. Two things follow. A program that hides text by drawing it in the background colour shows that text. Text hidden with the terminal's conceal attribute (SGR 8), as a password prompt does, stays hidden. In a pane on another machine, that takes zterm on the host to be at least as new as this one: an older host doesn't say which text is concealed, so its concealed text is adjusted like any other. And a bar a program draws out of block characters in a colour close to the background is lightened or darkened like text.
A theme name zterm can't find
theme is the one setting that warns instead of refusing. Anywhere else a value zterm doesn't understand stops the whole file, but a bad theme name opens the terminal on dark and says so, on stderr and in the splash notice, naming what you typed and listing what would have worked.
The reason is that a theme is a file. zterm can't tell a name it has never heard of from a name whose file has a stray character on line 12, and neither is a reason to refuse to open a terminal.
zterm theme --list
That prints what this zterm can draw right now, one name per line, and says on stderr why anything is missing.
Writing your own theme
Themes live in themes/, beside your settings file: ~/.config/zterm/themes/ on macOS and Linux, %APPDATA%\zterm\themes\ on Windows. Any *.toml in there is a theme, named by its file stem, so themes/mine.toml is theme = "mine".
The first time zterm runs it writes ten of the twelve into that directory, and it never does it again. A theme you delete stays deleted and a theme you edit stays edited. dark and light aren't written out: they're the floor zterm falls back to, so a dark.toml there is reported and skipped rather than obeyed.
To start from a copy:
zterm theme --template dark > ~/.config/zterm/themes/mine.toml
It prints rather than writes, so you choose the name and your shell answers the overwrite question. All twelve have a template, including dark and light.
A theme file is a name people read, a [palette] a pane's contents resolve from, and a [chrome] the bar, buttons and scrims resolve from. The chrome half is five values: a ground, an ink, an accent, a danger colour, and whether the theme is dark. zterm works out the other thirty-three against the contrast ratios it holds every theme to. [chrome.overrides] is where you say it got one wrong.
Themes are read at startup and on Reload Settings, not watched. Write the file, reload, and every open pane has it. A file that doesn't parse takes only its own theme out of the list, and it's named on stderr with the line number.
Where zterm departs from a vendor's palette
The vendor themes use the vendor's published sixteen colours, with one exception. Solarized publishes bright black as #002b36, which is also Solarized Dark's background, so text in bright black can't be seen there. Programs use bright black for grey, de-emphasised text. prettier, for one, prints the name of every file it left unchanged in it, and under the published value its output shows only the timings, each starting at a different column.
solarized-dark draws bright black as #586e75, the grey Solarized uses for secondary text. It's the same colour as the theme's bright green. A program that used bright black to paint something in the background colour now paints it grey.
Upgrading zterm doesn't change a theme file it has already written, so a solarized-dark.toml from an earlier version keeps #002b36.
The font
zterm ships JetBrains Mono compiled into the binary, so the grid is the same size on every machine. Two more faces ship beside it: Nerd Fonts symbols for icons, and a subset that puts the braille spinners agent harnesses animate on the grid. Your own fonts sit behind all three for CJK and emoji.
To draw in something else, set the family by name:
font_family = "Menlo"
font_size = 14.0
Or open the settings editor and choose Set font. The list draws a short sample in each family beside its name, so you can see a face before you pick it.
zterm takes any font that's installed and sits on a grid. It checks the grid by measuring rather than by trusting what the font declares, because a uniform face sometimes declares otherwise: it shapes M, i, W and l and compares the widths. A name that isn't installed, and a font whose letters come out different widths, both leave you on the bundled face, and the splash says which of the two it was.
Characters the chosen face lacks are drawn from the bundled one, so box drawing and block elements stay where they should be. To see which font answered for what:
zterm ls-fonts "abc ⠋ 字"
It prints a JSON report with an entry per character: the family that drew it, whether it came out drawable, and a source of host or bundled. "source": "host" marks the characters that are no longer the same on every machine. It exits 1 if any character has no glyph anywhere, which makes it worth running in a container before you wonder why the boxes are empty. It opens no window, so it also works on a machine where zterm itself won't start.
Where to go next
- Settings reference: every setting, including
font_size,font_familyandtheme. - Troubleshooting: what to do when a theme or a font doesn't take.