feat: add option to disable sgr pixel mode support

Defaults to enabled.

closes #440
This commit is contained in:
CJ van den Berg 2026-01-22 16:15:53 +01:00
parent 2ee92d2548
commit 3995946471
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 8 additions and 1 deletions

View file

@ -30,6 +30,7 @@ tty_buffer: []u8,
cache_storage: GraphemeCache.Storage = .{},
no_alternate: bool,
enable_sgr_pixel_mode_support: bool = true,
event_buffer: std.Io.Writer.Allocating,
input_buffer: std.Io.Writer.Allocating,
mods: vaxis.Key.Modifiers = .{},
@ -383,7 +384,7 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
},
.cap_sgr_pixels => {
self.logger.print("pixel mouse capability detected", .{});
self.vx.caps.sgr_pixels = true;
self.vx.caps.sgr_pixels = self.enable_sgr_pixel_mode_support;
},
.cap_da1 => {
self.queries_done = true;
@ -469,6 +470,10 @@ fn handle_bracketed_paste_error(self: *Self, e: Error) !void {
return e;
}
pub fn set_sgr_pixel_mode_support(self: *Self, enable_sgr_pixel_mode_support: bool) void {
self.enable_sgr_pixel_mode_support = enable_sgr_pixel_mode_support;
}
pub fn set_terminal_title(self: *Self, text: []const u8) void {
self.vx.setTitle(self.tty.writer(), text) catch {};
}