Add better and configurable shortcuts.

This commit is contained in:
Greyson Parrelli
2026-08-15 00:00:06 -04:00
parent 043b994a15
commit a742b51d3b
6 changed files with 987 additions and 136 deletions
+15
View File
@@ -115,6 +115,21 @@ pub fn build(b: *std.Build) void {
settings_tests.root_module.addImport("ghostty-vt", ghostty.module("ghostty-vt"));
test_step.dependOn(&b.addRunArtifact(settings_tests).step);
// The shortcut table is its own root for the same reason: chords are parsed
// from text, written back out as text, and looked up by a key press, and
// all three are pure data. It reaches libghostty-vt for the key enum and
// nothing else, which is what keeps it — and the settings tests above, which
// import it — off GTK.
const shortcut_tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("src/shortcuts.zig"),
.target = target,
.optimize = optimize,
}),
});
shortcut_tests.root_module.addImport("ghostty-vt", ghostty.module("ghostty-vt"));
test_step.dependOn(&b.addRunArtifact(shortcut_tests).step);
// A second root for the same reason, one step further out: `emoji.zig` is a
// table and a search over it, and it imports nothing at all. It cannot hang
// off the root above because a test binary has exactly one root, and