note charsets are TODO

This commit is contained in:
Mitchell Hashimoto
2022-08-26 09:27:51 -07:00
parent 551de6eda4
commit a1130095f8
3 changed files with 16 additions and 2 deletions

View File

@ -38,3 +38,4 @@ Major Features:
* Kitty keyboard protocol: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
* Kitty graphics protocol: https://sw.kovidgoyal.net/kitty/graphics-protocol/
* Mouse events
* Charsets (i.e. line drawing, `CSI ( B` and so on)

View File

@ -10,7 +10,13 @@ pub const Attribute = union(enum) {
unset: void,
/// Unknown attribute, the raw CSI command parameters are here.
unknown: []const u16,
unknown: struct {
/// Full is the full SGR input.
full: []const u16,
/// Partial is the remaining, where we got hung up.
partial: []const u16,
},
/// Bold the text.
bold: void,
@ -149,7 +155,7 @@ pub const Parser = struct {
else => {},
}
return Attribute{ .unknown = slice };
return Attribute{ .unknown = .{ .full = self.params, .partial = slice } };
}
};

View File

@ -413,6 +413,13 @@ pub fn Stream(comptime Handler: type) type {
action: Parser.Action.ESC,
) !void {
switch (action.final) {
// Charsets
'B' => {
// TODO: Charset support. Just ignore this for now because
// every application sets this and it makes our logs SO
// noisy.
},
// DECSC - Save Cursor
'7' => if (@hasDecl(T, "saveCursor")) switch (action.intermediates.len) {
0 => try self.handler.saveCursor(),