mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
SGR 39/49 (reset fg/bg, respectively)
This commit is contained in:
@ -324,6 +324,10 @@ pub fn setAttribute(self: *Terminal, attr: sgr.Attribute) !void {
|
|||||||
|
|
||||||
.@"8_bg" => |n| self.screen.cursor.pen.bg = color.default[@enumToInt(n)],
|
.@"8_bg" => |n| self.screen.cursor.pen.bg = color.default[@enumToInt(n)],
|
||||||
|
|
||||||
|
.reset_fg => self.screen.cursor.pen.fg = null,
|
||||||
|
|
||||||
|
.reset_bg => self.screen.cursor.pen.bg = null,
|
||||||
|
|
||||||
.@"8_bright_fg" => |n| self.screen.cursor.pen.fg = color.default[@enumToInt(n)],
|
.@"8_bright_fg" => |n| self.screen.cursor.pen.fg = color.default[@enumToInt(n)],
|
||||||
|
|
||||||
.@"8_bright_bg" => |n| self.screen.cursor.pen.bg = color.default[@enumToInt(n)],
|
.@"8_bright_bg" => |n| self.screen.cursor.pen.bg = color.default[@enumToInt(n)],
|
||||||
|
@ -41,6 +41,10 @@ pub const Attribute = union(enum) {
|
|||||||
@"8_bg": color.Name,
|
@"8_bg": color.Name,
|
||||||
@"8_fg": color.Name,
|
@"8_fg": color.Name,
|
||||||
|
|
||||||
|
/// Reset the fg/bg to their default values.
|
||||||
|
reset_fg: void,
|
||||||
|
reset_bg: void,
|
||||||
|
|
||||||
/// Set the background/foreground as a named bright color attribute.
|
/// Set the background/foreground as a named bright color attribute.
|
||||||
@"8_bright_bg": color.Name,
|
@"8_bright_bg": color.Name,
|
||||||
@"8_bright_fg": color.Name,
|
@"8_bright_fg": color.Name,
|
||||||
@ -118,6 +122,8 @@ pub const Parser = struct {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
39 => return Attribute{ .reset_fg = {} },
|
||||||
|
|
||||||
40...47 => return Attribute{
|
40...47 => return Attribute{
|
||||||
.@"8_bg" = @intToEnum(color.Name, slice[0] - 40),
|
.@"8_bg" = @intToEnum(color.Name, slice[0] - 40),
|
||||||
},
|
},
|
||||||
@ -144,6 +150,8 @@ pub const Parser = struct {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
49 => return Attribute{ .reset_bg = {} },
|
||||||
|
|
||||||
90...97 => return Attribute{
|
90...97 => return Attribute{
|
||||||
.@"8_bright_fg" = @intToEnum(color.Name, slice[0] - 90),
|
.@"8_bright_fg" = @intToEnum(color.Name, slice[0] - 90),
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user