mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
urxvt reporting format
This commit is contained in:
@ -920,6 +920,19 @@ fn mouseReport(
|
||||
try self.queueWrite(resp);
|
||||
},
|
||||
|
||||
.urxvt => {
|
||||
// Response always is at least 4 chars, so this leaves the
|
||||
// remainder for numbers which are very large...
|
||||
var buf: [32]u8 = undefined;
|
||||
const resp = try std.fmt.bufPrint(&buf, "\x1B[{d};{d};{d}M", .{
|
||||
32 + button_code,
|
||||
viewport_point.x + 1,
|
||||
viewport_point.y + 1,
|
||||
});
|
||||
|
||||
try self.queueWrite(resp);
|
||||
},
|
||||
|
||||
else => @panic("TODO"),
|
||||
}
|
||||
}
|
||||
@ -1499,6 +1512,7 @@ pub fn setMode(self: *Window, mode: terminal.Mode, enabled: bool) !void {
|
||||
|
||||
.mouse_format_utf8 => self.terminal.modes.mouse_format = if (enabled) .utf8 else .x10,
|
||||
.mouse_format_sgr => self.terminal.modes.mouse_format = if (enabled) .sgr else .x10,
|
||||
.mouse_format_urxvt => self.terminal.modes.mouse_format = if (enabled) .urxvt else .x10,
|
||||
|
||||
else => if (enabled) log.warn("unimplemented mode: {}", .{mode}),
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ pub const MouseFormat = enum(u3) {
|
||||
x10 = 0,
|
||||
utf8 = 1, // 1005
|
||||
sgr = 2, // 1006
|
||||
urxvt = 3, // 1015
|
||||
|
||||
// TODO:
|
||||
urxvt = 3, // 1015
|
||||
sgr_pixels = 4, // 1016
|
||||
};
|
||||
|
||||
|
@ -86,6 +86,9 @@ pub const Mode = enum(u16) {
|
||||
/// Report mouse position in the SGR format.
|
||||
mouse_format_sgr = 1006,
|
||||
|
||||
/// Report mouse position in the urxvt format.
|
||||
mouse_format_urxvt = 1015,
|
||||
|
||||
/// Alternate screen mode with save cursor and clear on enter.
|
||||
alt_screen_save_cursor_clear_enter = 1049,
|
||||
|
||||
|
Reference in New Issue
Block a user