parse ConEmu OSC9;3 (#4644)

This PR implements support for the [ConEmu OSC9;3 escape
sequence](https://conemu.github.io/en/AnsiEscapeCodes.html#OSC_Operating_system_commands).

| Sequence | Description |
| - | - |
ESC ] 9 ; 3 ; ”txt“ ST | Change ConEmu Tab to txt. Set empty string to
return original Tab text

#3125
This commit is contained in:
Mitchell Hashimoto
2025-01-05 12:35:43 -08:00
committed by GitHub
3 changed files with 96 additions and 1 deletions

View File

@@ -208,6 +208,20 @@ pub const VTEvent = struct {
);
},
.Union => |info| {
const Tag = info.tag_type orelse @compileError("Unions must have a tag");
const tag_name = @tagName(@as(Tag, v));
inline for (info.fields) |field| {
if (std.mem.eql(u8, field.name, tag_name)) {
if (field.type == void) {
break try md.put("data", tag_name);
} else {
break try encodeMetadataSingle(alloc, md, tag_name, @field(v, field.name));
}
}
}
},
else => {
@compileLog(T);
@compileError("unsupported type, see log");