Skip to main content

ghostty-yazi-flavor

PyPI

Generate a yazi flavor from your active Ghostty theme — so yazi's hover bars, mode pills, and code-preview syntax highlighting actually match your terminal instead of fighting it.

Why

Yazi's default theme follows your terminal's 16-color ANSI palette, which gets you most of the way — but two things don't follow it:

  1. Code-preview highlighting uses syntect's built-in default theme, which ignores your palette entirely. On most themes that means a wall of mismatched color over the wrong background.
  2. Hover indicators use reverse-video: the hovered row becomes a solid block of its own text color. If your theme keeps something loud in its blue slot, every hover is a neon bar.

Hand-made flavors fix this for popular themes (catppuccin, dracula, …). For the other ~450 themes Ghostty ships with — or your own custom one — this tool generates the flavor from whatever theme is actually active.

How it works

It runs ghostty +show-config, which prints the resolved config with the active theme's palette already applied (built-in themes, custom themes in ~/.config/ghostty/themes, includes — all handled by Ghostty itself). From those 16 colors + background/foreground/selection it writes:

~/.config/yazi/flavors/ghostty.yazi/
├── flavor.toml    # hover bars, mode pills, tabs, borders — palette-derived
└── tmtheme.xml    # code-preview highlighting built from your actual colors

The flavor is deliberately partial: everything yazi's preset already gets right by following ANSI colors is left alone; only the spots that ignore the palette (or follow it badly) are overridden.

Install

uv tool install ghostty-yazi-flavor
# or: pipx install ghostty-yazi-flavor

Then point yazi at the flavor in ~/.config/yazi/theme.toml:

[flavor]
dark = "ghostty"
light = "ghostty"

Use

ghostty-yazi-flavor                    # regenerate from the current theme
ghostty-yazi-flavor status             # what's generated, is the watcher on

Change your Ghostty theme → run it again → restart yazi. The full grammar is generate (the default; takes --out <dir> and --ghostty <path>), install-watcher [--print], uninstall-watcher, and status.

Automatic regeneration

ghostty-yazi-flavor install-watcher    # set it and forget it

Installs a file watcher on your Ghostty config (and custom themes directory, if you have one), so the flavor regenerates on every config write — including saves that you follow with Ghostty's reload-config keybinding:

  • macOS: a launchd LaunchAgent using WatchPaths — event-driven, no polling, no dependencies. Logs to ~/Library/Logs/ghostty-yazi-flavor.log.
  • Linux: systemd user units (a .path watching the config + a oneshot .service).

--print shows exactly what would be installed without touching anything; ghostty-yazi-flavor uninstall-watcher removes it cleanly.

Non-systemd Linux: run a watch loop under your supervisor of choice (supervisord, runit, …):

inotifywait -m -e close_write ~/.config/ghostty/config | while read -r _; do
  ghostty-yazi-flavor
done

chezmoi: if your Ghostty config is managed there, skip the watcher and hook regeneration to the source of truth instead:

# .chezmoiscripts/run_onchange_after_sync-yazi-flavor.sh.tmpl
#!/bin/bash
set -euo pipefail
# ghostty config hash: {{ include "dot_config/ghostty/config" | sha256sum }}
"$HOME/.local/bin/ghostty-yazi-flavor"

tmux note

If yazi renders colorless inside tmux, the pane environment is missing COLORTERM. Add to your tmux.conf:

set -ga update-environment COLORTERM

License

MIT

Metadata

Release files for ghostty-yazi-flavor 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghostty-yazi-flavor 0.2.0
File Size Uploaded
ghostty_yazi_flavor-0.2.0.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghostty-yazi-flavor 0.2.0
File Interpreter ABI Platform
ghostty_yazi_flavor-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / ghostty_yazi_flavor-0.2.0.tar.gz

Download URL ghostty_yazi_flavor-0.2.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2f908479be5ca41aad30ff370cbd17cfb7dbba1a3ae09b4a0f642ac09605b37c
BLAKE2b-256 checksum
How to use checksums
f6fc8f6aed8c91a0bcfe83ecccf987f4c8267171515a44bbba7b49e0f24183bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ghostty_yazi_flavor-0.2.0-py3-none-any.whl

Download URL ghostty_yazi_flavor-0.2.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e26ba3d5a93b39181e66b7e386b9ff81105e3954ea11e281b615e1e91bdbd082
BLAKE2b-256 checksum
How to use checksums
8252ee015163aa3303938568fff3a7ba50c1f45670024ca5ad02629c1f40c1c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page