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:
1 parent
fb5602452a
commit
df261910c5
26 files changed
+920
-132
No files matched your search
@@ -243,3 +243,50 @@ func TestUpdateHintShown(t *testing.T) {
|
||||
t.Errorf("header without an update: %q", h)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOldNameIsRenamed(t *testing.T) {
|
||||
a := newTestApp(t, "# big scrollback\nscrollback-limit = 100000000\n")
|
||||
a.selectCategory(0)
|
||||
old := a.selected()
|
||||
if old == nil || old.Key != "scrollback-limit" {
|
||||
t.Fatalf("selected = %v", old)
|
||||
}
|
||||
if doc := ansi.Strip(a.docContent(old, 100)); !strings.Contains(doc, "old name of") || strings.Contains(doc, "misspelled") {
|
||||
t.Errorf("doc of the old name:\n%s", doc)
|
||||
}
|
||||
// The current option shows the value set under its old name.
|
||||
doc := ansi.Strip(a.docContent(a.sch.Lookup("scrollback-limit-bytes"), 100))
|
||||
if !strings.Contains(doc, "100000000 ● set as scrollback-limit") || !strings.Contains(doc, "also reads the old name") {
|
||||
t.Errorf("doc of the new name:\n%s", doc)
|
||||
}
|
||||
|
||||
press(a, "enter")
|
||||
if got := string(a.file.Bytes()); got != "# big scrollback\nscrollback-limit-bytes = 100000000\n" {
|
||||
t.Fatalf("after rename:\n%s", got)
|
||||
}
|
||||
if o := a.selected(); o == nil || o.Key != "scrollback-limit-bytes" {
|
||||
t.Errorf("selected after rename = %v", o)
|
||||
}
|
||||
press(a, "u")
|
||||
if !a.file.Has("scrollback-limit") || a.dirty() {
|
||||
t.Error("undo did not restore the old name")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOldValueAndReplacedOption(t *testing.T) {
|
||||
a := newTestApp(t, "copy-on-select = true\nbold-is-bright = true\n")
|
||||
doc := ansi.Strip(a.docContent(a.sch.Lookup("copy-on-select"), 100))
|
||||
if strings.Contains(doc, "invalid") || !strings.Contains(doc, "an old value") || !strings.Contains(doc, "none, primary, clipboard, both") {
|
||||
t.Errorf("doc of copy-on-select = true:\n%s", doc)
|
||||
}
|
||||
doc = ansi.Strip(a.docContent(a.option("bold-is-bright"), 100))
|
||||
if !strings.Contains(doc, "now sets bold-color") || strings.Contains(doc, "misspelled") {
|
||||
t.Errorf("doc of bold-is-bright:\n%s", doc)
|
||||
}
|
||||
// Not renamed: enter edits the line as text.
|
||||
a.selectCategory(0)
|
||||
press(a, "down", "enter")
|
||||
if a.editor == nil {
|
||||
t.Error("enter on a replaced option opens no editor")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user