diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-04 15:04:52 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-10-04 20:19:39 -0700 |
| commit | 44496df8994640975720938fb150a67e7d111663 (patch) | |
| tree | 40b3e2cd4f19d5fb37ddc3c1d1a2a36d8048bd09 /src/input/function_keys.zig | |
| parent | 503a25653f0608b946ddfa1742130c39c5ccf575 (diff) | |
input: use std.Io.Writer for key encoder, new API, expose via libghostty
This modernizes `KeyEncoder` to a new `std.Io.Writer`-based API.
Additionally, instead of a single struct, it is now an `encode` function
that takes a series of more focused options. This is more idiomatic Zig
while also making it easier to expose via libghostty-vt.
libghostty-vt also gains access to key encoding APIs.
Diffstat (limited to 'src/input/function_keys.zig')
| -rw-r--r-- | src/input/function_keys.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input/function_keys.zig b/src/input/function_keys.zig index 8c89b39bd..efe86d9e3 100644 --- a/src/input/function_keys.zig +++ b/src/input/function_keys.zig @@ -293,6 +293,11 @@ fn pcStyle(comptime fmt: []const u8) []Entry { test "keys" { const testing = std.testing; + switch (@import("terminal_options").artifact) { + .ghostty => {}, + // Don't want to bring in termio into libghostty-vt + .lib => return error.SkipZigTest, + } // Force resolution for comptime evaluation. _ = keys; |
