Support Ghostty 1.4, version 1.0.2

The built-in schema now describes Ghostty 1.4.0: 212 options, the new
choices of copy-on-select, window-padding-balance = equal, number limits
that also take "unlimited", and categories for the new options.

genschema reads Ghostty's compatibility table, so old names and values
Ghostty still accepts are no longer reported as errors: a renamed key
such as scrollback-limit is shown in yellow and renamed in place with
enter, a replaced option names its successors, and old values such as
copy-on-select = true are accepted with a note.

Theme previews expand ~/ like Ghostty 1.4 and only look where Ghostty
looks for user themes. Theme names with parentheses of their own keep
them. A live test checks every ghostty command against the installed
Ghostty. Docs and screenshots updated for 1.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mikeandClaude Opus 5.5 committed 2026-10-28 10:44:23 +01:00
1 parent fb5602452a
commit df261910c5
26 files changed
+920 -132

No files matched your search

+57 -8
View File
@@ -195,14 +195,62 @@ func (a *App) option(key string) *schema.Option {
Kind: schema.KindText,
Repeatable: len(a.file.GetAll(key)) > 1,
Category: catSet,
Doc: "This key is not a known Ghostty " + a.sch.GhosttyVersion + " option. " +
}
v := a.sch.GhosttyVersion
switch c := a.sch.OldKey(key); {
case c != nil && c.RenamedTo != "":
o.Doc = "This is the old name of `" + c.RenamedTo + "`. Ghostty " + v + " still reads it, " +
"so it keeps working, but it is no longer documented. " +
"Press enter to rename it to `" + c.RenamedTo + "`; the value stays as it is."
if n := a.sch.Lookup(c.RenamedTo); n != nil && n.Doc != "" {
o.Doc += "\n\n" + n.Doc
}
case c != nil:
o.Doc = "This is an old option that Ghostty " + v + " still reads for compatibility. " +
"It now sets `" + strings.Join(c.Sets, "`, `") + "` instead. " +
"Set those directly, then press r to remove this line."
default:
o.Doc = "This key is not a known Ghostty " + v + " option. " +
"It may be misspelled or belong to a different Ghostty version. " +
"Ghostty will report it as an error; press r to remove it.",
"Ghostty will report it as an error; press r to remove it."
}
a.unknown[key] = o
return o
}
// oldName returns the old key under which the file sets o, and its value.
func (a *App) oldName(o *schema.Option) (key, value string, ok bool) {
for _, old := range a.sch.OldNames(o.Key) {
if v, found := a.file.Get(old); found {
key, value, ok = old, v, true
}
}
return key, value, ok
}
// renameKey gives the entries of an old key their current name, keeping
// their values and their place in the file, and selects the result.
func (a *App) renameKey(old, new string) {
before := a.file.Clone()
a.file.Rename(old, new)
a.pushUndo(before, old)
a.setStatus("Renamed "+old+" to "+new+".", stChanged)
a.rebuild()
for i, o := range a.opts {
if o.Key == new {
a.optIdx = i
}
}
}
func (a *App) pushUndo(before *config.File, key string) {
a.rev++
a.undo = append(a.undo, undoEntry{file: before, key: key})
if len(a.undo) > 500 {
a.undo = a.undo[1:]
}
}
func (a *App) selected() *schema.Option {
if a.optIdx >= 0 && a.optIdx < len(a.opts) {
return a.opts[a.optIdx]
@@ -516,8 +564,13 @@ func (a *App) updateBrowse(km tea.KeyMsg) tea.Cmd {
return nil
}
// edit opens the editor for o. Booleans are toggled directly.
// edit opens the editor for o. Booleans are toggled directly, and the old
// name of an option is renamed to the current one.
func (a *App) edit(o *schema.Option) tea.Cmd {
if c := a.sch.OldKey(o.Key); c != nil && c.RenamedTo != "" {
a.renameKey(c.Key, c.RenamedTo)
return nil
}
if o.Kind == schema.KindBool && !o.Repeatable {
a.quickToggle(o)
return nil
@@ -693,11 +746,7 @@ func (a *App) apply(o *schema.Option, res *result) {
if a.file.Equal(before) {
return
}
a.rev++
a.undo = append(a.undo, undoEntry{file: before, key: o.Key})
if len(a.undo) > 500 {
a.undo = a.undo[1:]
}
a.pushUndo(before, o.Key)
switch {
case res.values == nil:
a.setStatus("Reset "+o.Key+" to its default.", stChanged)