termio: send VT220 device attributes on request, add secondary

This commit is contained in:
Mitchell Hashimoto
2023-08-15 08:12:46 -07:00
parent 2e54a825bf
commit d27bc1f0fe
2 changed files with 11 additions and 3 deletions

View File

@ -514,7 +514,7 @@ pub fn Stream(comptime Handler: type) type {
switch (action.params.len) {
1 => @enumFromInt(action.params[0]),
else => {
log.warn("invalid erase characters command: {}", .{action});
log.warn("invalid device status report command: {}", .{action});
return;
},
},

View File

@ -1297,9 +1297,17 @@ const StreamHandler = struct {
) !void {
_ = params;
// For the below, we quack as a VT220. We don't quack as
// a 420 because we don't support DCS sequences.
switch (req) {
// VT220
.primary => self.messageWriter(.{ .write_stable = "\x1B[?62;c" }),
.primary => self.messageWriter(.{
.write_stable = "\x1B[?62;22c",
}),
.secondary => self.messageWriter(.{
.write_stable = "\x1B[>1;10;0c",
}),
else => log.warn("unimplemented device attributes req: {}", .{req}),
}
}