diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 45fe9dfc6..10d33a3a8 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -134,6 +134,10 @@ pub const Cursor = struct { /// because its most likely null. hyperlink: ?*hyperlink.Hyperlink = null, + /// The current semantic content type for the cursor that will be + /// applied to any newly written cells. + semantic_content: pagepkg.Cell.SemanticContent = .output, + /// The pointers into the page list where the cursor is currently /// located. This makes it faster to move the cursor. page_pin: *PageList.Pin, diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index a955cbcae..ac11ead3e 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -711,6 +711,7 @@ fn printCell( .style_id = self.screens.active.cursor.style_id, .wide = wide, .protected = self.screens.active.cursor.protected, + .semantic_content = self.screens.active.cursor.semantic_content, }; if (style_changed) { @@ -11236,6 +11237,7 @@ test "Terminal: fullReset with a non-empty pen" { try t.setAttribute(.{ .direct_color_fg = .{ .r = 0xFF, .g = 0, .b = 0x7F } }); try t.setAttribute(.{ .direct_color_bg = .{ .r = 0xFF, .g = 0, .b = 0x7F } }); + t.screens.active.cursor.semantic_content = .input; t.fullReset(); { @@ -11248,6 +11250,7 @@ test "Terminal: fullReset with a non-empty pen" { } try testing.expectEqual(@as(style.Id, 0), t.screens.active.cursor.style_id); + try testing.expectEqual(.output, t.screens.active.cursor.semantic_content); } test "Terminal: fullReset hyperlink" {