feat: add Ghostty terminal support (#225)

Add shipwright runner for Ghostty terminal emulator with example themes.

- Add ghostty.lua runner with Ghostty-specific color format
- Update init.lua to include ghostty in runner_files
- Add zenbones_dark and zenbones_light example themes

Ghostty uses a similar format to Kitty but with `=` separators and
`palette = N=COLOR` syntax for the 16 ANSI colors.

Tested and working with Ghostty terminal.
This commit is contained in:
Fredrik Averpil
2025-12-01 15:27:32 +01:00
committed by GitHub
parent a934bc07d2
commit 3da02e553a
21 changed files with 772 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
local helpers = require "shipwright.transform.helpers"
local base_template = [[
# Ghostty color configuration
# See: https://ghostty.org/docs/config/reference
# Basic colors
foreground = "$fg"
background = "$bg"
# Selection colors
selection-foreground = "$selection_fg"
selection-background = "$selection_bg"
# Cursor colors
cursor-color = "$cursor_bg"
cursor-text = "$cursor_fg"
# The basic 16 colors
# black
palette = 0=$black
palette = 8=$bright_black
# red
palette = 1=$red
palette = 9=$bright_red
# green
palette = 2=$green
palette = 10=$bright_green
# yellow
palette = 3=$yellow
palette = 11=$bright_yellow
# blue
palette = 4=$blue
palette = 12=$bright_blue
# magenta
palette = 5=$magenta
palette = 13=$bright_magenta
# cyan
palette = 6=$cyan
palette = 14=$bright_cyan
# white
palette = 7=$white
palette = 15=$bright_white]]
local function ghostty_conf(colors)
local text = helpers.apply_template(base_template, colors)
return helpers.split_newlines(text)
end
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
run(
{ specs, p, term },
transform.colorscheme_to_term_colors,
ghostty_conf,
{ prepend, "# This file is auto-generated by shipwright.nvim" },
{ overwrite, string.format("extras/ghostty/%s", name) }
)
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global