mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +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 testing = std.testing;
|
||||
@ -44,6 +44,10 @@ pub const Attribute = union(enum) {
|
||||
inverse: void,
|
||||
reset_inverse: void,
|
||||
|
||||
/// Invisible
|
||||
invisible: void,
|
||||
reset_invisible: void,
|
||||
|
||||
/// Strikethrough the text.
|
||||
strikethrough: void,
|
||||
reset_strikethrough: void,
|
||||
@ -163,6 +167,8 @@ pub const Parser = struct {
|
||||
|
||||
7 => return Attribute{ .inverse = {} },
|
||||
|
||||
8 => return Attribute{ .invisible = {} },
|
||||
|
||||
9 => return Attribute{ .strikethrough = {} },
|
||||
|
||||
22 => return Attribute{ .reset_bold = {} },
|
||||
@ -175,6 +181,8 @@ pub const Parser = struct {
|
||||
|
||||
27 => return Attribute{ .reset_inverse = {} },
|
||||
|
||||
28 => return Attribute{ .reset_invisible = {} },
|
||||
|
||||
29 => return Attribute{ .reset_strikethrough = {} },
|
||||
|
||||
30...37 => return Attribute{
|
||||
@ -499,3 +507,9 @@ test "sgr: reset underline color" {
|
||||
var p: Parser = .{ .params = &[_]u16{59} };
|
||||
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