mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +03:00
terminal: test IND preserves background sgr
This commit is contained in:
@ -3177,6 +3177,32 @@ test "Terminal: index bottom of primary screen" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "Terminal: index bottom of primary screen background sgr" {
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
var t = try init(alloc, 5, 5);
|
||||||
|
defer t.deinit(alloc);
|
||||||
|
|
||||||
|
const pen: Screen.Cell = .{
|
||||||
|
.bg = .{ .r = 0xFF, .g = 0x00, .b = 0x00 },
|
||||||
|
.attrs = .{ .has_bg = true },
|
||||||
|
};
|
||||||
|
|
||||||
|
t.setCursorPos(5, 1);
|
||||||
|
try t.print('A');
|
||||||
|
t.screen.cursor.pen = pen;
|
||||||
|
try t.index();
|
||||||
|
|
||||||
|
{
|
||||||
|
var str = try t.plainString(testing.allocator);
|
||||||
|
defer testing.allocator.free(str);
|
||||||
|
try testing.expectEqualStrings("\n\n\nA", str);
|
||||||
|
for (0..5) |x| {
|
||||||
|
const cell = t.screen.getCell(.active, 4, x);
|
||||||
|
try testing.expectEqual(pen, cell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Terminal: index inside scroll region" {
|
test "Terminal: index inside scroll region" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 5, 5);
|
var t = try init(alloc, 5, 5);
|
||||||
|
Reference in New Issue
Block a user