mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
implement erase display scrollback ("clear" command)
This commit is contained in:
@ -116,8 +116,6 @@ pub const RowIndex = union(RowIndexTag) {
|
||||
/// The index is from the top of the history (scrollback) to just
|
||||
/// prior to the active area.
|
||||
history: usize,
|
||||
|
||||
// TODO: others
|
||||
};
|
||||
|
||||
/// The tags of RowIndex
|
||||
|
@ -597,9 +597,15 @@ pub fn eraseDisplay(
|
||||
self.screen.cursor.pending_wrap = false;
|
||||
},
|
||||
|
||||
else => {
|
||||
log.err("unimplemented display mode: {}", .{mode});
|
||||
@panic("unimplemented");
|
||||
.scrollback => {
|
||||
const region = self.screen.region(.history);
|
||||
std.mem.set(Screen.Cell, region[0], self.screen.cursor.pen);
|
||||
std.mem.set(Screen.Cell, region[1], self.screen.cursor.pen);
|
||||
|
||||
// TODO: move this logic to the Screen implementation
|
||||
self.screen.top = self.screen.visible_offset;
|
||||
self.screen.bottom = self.screen.bottom - self.screen.visible_offset;
|
||||
self.screen.visible_offset = 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user