From d27bc1f0fe14fa8d2361c1401fb72af1f63d5de8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Aug 2023 08:12:46 -0700 Subject: [PATCH] termio: send VT220 device attributes on request, add secondary --- src/terminal/stream.zig | 2 +- src/termio/Exec.zig | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index 39d6a03db..ea3b2a736 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -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; }, }, diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 1aec3f269..64c4dfa96 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -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}), } }