feat(tui): show screen dimentions on resize
This commit is contained in:
parent
4842002136
commit
142f6e51ae
1 changed files with 7 additions and 0 deletions
|
@ -311,6 +311,8 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void {
|
|||
|
||||
if (try m.match(.{"resize"})) {
|
||||
self.resize();
|
||||
const box = self.screen();
|
||||
message("{d}x{d}", .{ box.w, box.h });
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1174,3 +1176,8 @@ pub fn is_cursor_beam(self: *Self) bool {
|
|||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn message(comptime fmt: anytype, args: anytype) void {
|
||||
var buf: [256]u8 = undefined;
|
||||
tp.self_pid().send(.{ "message", std.fmt.bufPrint(&buf, fmt, args) catch @panic("too large") }) catch {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue