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 keyboard protocol: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
* Kitty graphics protocol: https://sw.kovidgoyal.net/kitty/graphics-protocol/ * Kitty graphics protocol: https://sw.kovidgoyal.net/kitty/graphics-protocol/
* Mouse events * 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, unset: void,
/// Unknown attribute, the raw CSI command parameters are here. /// 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 the text.
bold: void, bold: void,
@ -149,7 +155,7 @@ pub const Parser = struct {
else => {}, 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, action: Parser.Action.ESC,
) !void { ) !void {
switch (action.final) { 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 // DECSC - Save Cursor
'7' => if (@hasDecl(T, "saveCursor")) switch (action.intermediates.len) { '7' => if (@hasDecl(T, "saveCursor")) switch (action.intermediates.len) {
0 => try self.handler.saveCursor(), 0 => try self.handler.saveCursor(),