mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-30 11:01:42 +00:00
core: implement querying with OSC 4
This commit is contained in:
@@ -241,6 +241,25 @@ pub const VTEvent = struct {
|
||||
try alloc.dupeZ(u8, @tagName(value)),
|
||||
),
|
||||
|
||||
.Union => |u| if (u.tag_type) |Tag| {
|
||||
const tag_name = @tagName(@as(Tag, value));
|
||||
inline for (u.fields) |field| {
|
||||
if (std.mem.eql(u8, field.name, tag_name)) {
|
||||
const s = if (field.type == void)
|
||||
try alloc.dupeZ(u8, tag_name)
|
||||
else
|
||||
try std.fmt.allocPrintZ(alloc, "{s}={}", .{
|
||||
tag_name,
|
||||
@field(value, field.name),
|
||||
});
|
||||
|
||||
try md.put(key, s);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@compileError("Unions must have a tag");
|
||||
},
|
||||
|
||||
else => switch (Value) {
|
||||
u8 => try md.put(
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user