mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
terminal: SGR parse invisible (attr 8, 28)
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
//! SGR (Select Graphic Rendition) attribute parsing and types.
|
//! SGR (Select Graphic Rendition) attrinvbute parsing and types.
|
||||||
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
@ -44,6 +44,10 @@ pub const Attribute = union(enum) {
|
|||||||
inverse: void,
|
inverse: void,
|
||||||
reset_inverse: void,
|
reset_inverse: void,
|
||||||
|
|
||||||
|
/// Invisible
|
||||||
|
invisible: void,
|
||||||
|
reset_invisible: void,
|
||||||
|
|
||||||
/// Strikethrough the text.
|
/// Strikethrough the text.
|
||||||
strikethrough: void,
|
strikethrough: void,
|
||||||
reset_strikethrough: void,
|
reset_strikethrough: void,
|
||||||
@ -163,6 +167,8 @@ pub const Parser = struct {
|
|||||||
|
|
||||||
7 => return Attribute{ .inverse = {} },
|
7 => return Attribute{ .inverse = {} },
|
||||||
|
|
||||||
|
8 => return Attribute{ .invisible = {} },
|
||||||
|
|
||||||
9 => return Attribute{ .strikethrough = {} },
|
9 => return Attribute{ .strikethrough = {} },
|
||||||
|
|
||||||
22 => return Attribute{ .reset_bold = {} },
|
22 => return Attribute{ .reset_bold = {} },
|
||||||
@ -175,6 +181,8 @@ pub const Parser = struct {
|
|||||||
|
|
||||||
27 => return Attribute{ .reset_inverse = {} },
|
27 => return Attribute{ .reset_inverse = {} },
|
||||||
|
|
||||||
|
28 => return Attribute{ .reset_invisible = {} },
|
||||||
|
|
||||||
29 => return Attribute{ .reset_strikethrough = {} },
|
29 => return Attribute{ .reset_strikethrough = {} },
|
||||||
|
|
||||||
30...37 => return Attribute{
|
30...37 => return Attribute{
|
||||||
@ -499,3 +507,9 @@ test "sgr: reset underline color" {
|
|||||||
var p: Parser = .{ .params = &[_]u16{59} };
|
var p: Parser = .{ .params = &[_]u16{59} };
|
||||||
try testing.expect(p.next().? == .reset_underline_color);
|
try testing.expect(p.next().? == .reset_underline_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "sgr: invisible" {
|
||||||
|
var p: Parser = .{ .params = &[_]u16{ 8, 28 } };
|
||||||
|
try testing.expect(p.next().? == .invisible);
|
||||||
|
try testing.expect(p.next().? == .reset_invisible);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user