mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-28 02:03:55 +00:00
terminal: setAttribute
This commit is contained in:
@@ -317,6 +317,11 @@ pub const StreamHandler = struct {
|
||||
.end_of_command => self.endOfCommand(value.exit_code),
|
||||
.mouse_shape => try self.setMouseShape(value),
|
||||
.configure_charset => self.configureCharset(value.slot, value.charset),
|
||||
.set_attribute => switch (value) {
|
||||
.unknown => |unk| log.warn("unimplemented or unknown SGR attribute: {any}", .{unk}),
|
||||
else => self.terminal.setAttribute(value) catch |err|
|
||||
log.warn("error setting attribute {}: {}", .{ value, err }),
|
||||
},
|
||||
.dcs_hook => try self.dcsHook(value),
|
||||
.dcs_put => try self.dcsPut(value),
|
||||
.dcs_unhook => try self.dcsUnhook(),
|
||||
@@ -716,15 +721,6 @@ pub const StreamHandler = struct {
|
||||
}
|
||||
}
|
||||
|
||||
pub inline fn setAttribute(self: *StreamHandler, attr: terminal.Attribute) !void {
|
||||
switch (attr) {
|
||||
.unknown => |unk| log.warn("unimplemented or unknown SGR attribute: {any}", .{unk}),
|
||||
|
||||
else => self.terminal.setAttribute(attr) catch |err|
|
||||
log.warn("error setting attribute {}: {}", .{ attr, err }),
|
||||
}
|
||||
}
|
||||
|
||||
inline fn startHyperlink(self: *StreamHandler, uri: []const u8, id: ?[]const u8) !void {
|
||||
try self.terminal.screen.startHyperlink(uri, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user