feat: add option to disable sgr pixel mode support
Defaults to enabled. closes #440
This commit is contained in:
parent
2ee92d2548
commit
3995946471
3 changed files with 8 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ gutter_line_numbers_style: DigitStyle = .ascii,
|
||||||
gutter_symbols: bool = true,
|
gutter_symbols: bool = true,
|
||||||
enable_terminal_cursor: bool = true,
|
enable_terminal_cursor: bool = true,
|
||||||
enable_terminal_color_scheme: bool = false,
|
enable_terminal_color_scheme: bool = false,
|
||||||
|
enable_sgr_pixel_mode_support: bool = true,
|
||||||
enable_modal_dim: bool = true,
|
enable_modal_dim: bool = true,
|
||||||
highlight_current_line: bool = true,
|
highlight_current_line: bool = true,
|
||||||
highlight_current_line_gutter: bool = true,
|
highlight_current_line_gutter: bool = true,
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ tty_buffer: []u8,
|
||||||
cache_storage: GraphemeCache.Storage = .{},
|
cache_storage: GraphemeCache.Storage = .{},
|
||||||
|
|
||||||
no_alternate: bool,
|
no_alternate: bool,
|
||||||
|
enable_sgr_pixel_mode_support: bool = true,
|
||||||
event_buffer: std.Io.Writer.Allocating,
|
event_buffer: std.Io.Writer.Allocating,
|
||||||
input_buffer: std.Io.Writer.Allocating,
|
input_buffer: std.Io.Writer.Allocating,
|
||||||
mods: vaxis.Key.Modifiers = .{},
|
mods: vaxis.Key.Modifiers = .{},
|
||||||
|
|
@ -383,7 +384,7 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
|
||||||
},
|
},
|
||||||
.cap_sgr_pixels => {
|
.cap_sgr_pixels => {
|
||||||
self.logger.print("pixel mouse capability detected", .{});
|
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 => {
|
.cap_da1 => {
|
||||||
self.queries_done = true;
|
self.queries_done = true;
|
||||||
|
|
@ -469,6 +470,10 @@ fn handle_bracketed_paste_error(self: *Self, e: Error) !void {
|
||||||
return e;
|
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 {
|
pub fn set_terminal_title(self: *Self, text: []const u8) void {
|
||||||
self.vx.setTitle(self.tty.writer(), text) catch {};
|
self.vx.setTitle(self.tty.writer(), text) catch {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,7 @@ fn init(allocator: Allocator) InitError!*Self {
|
||||||
instance_ = self;
|
instance_ = self;
|
||||||
defer instance_ = null;
|
defer instance_ = null;
|
||||||
|
|
||||||
|
self.rdr_.set_sgr_pixel_mode_support(self.config_.enable_sgr_pixel_mode_support);
|
||||||
self.rdr_.handler_ctx = self;
|
self.rdr_.handler_ctx = self;
|
||||||
self.rdr_.dispatch_input = dispatch_input;
|
self.rdr_.dispatch_input = dispatch_input;
|
||||||
self.rdr_.dispatch_mouse = dispatch_mouse;
|
self.rdr_.dispatch_mouse = dispatch_mouse;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue