From 155cd099bade47d0a0ac3cc6b6da1a62416cc6d3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 29 Oct 2023 12:52:24 -0700 Subject: [PATCH] terminfo: add E3 for clear scrollback `clear(1)` uses this to clear scrollback unless supressed with `-x`. --- src/terminfo/ghostty.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/terminfo/ghostty.zig b/src/terminfo/ghostty.zig index b10408d28..e0c4f21fd 100644 --- a/src/terminfo/ghostty.zig +++ b/src/terminfo/ghostty.zig @@ -147,6 +147,10 @@ pub const ghostty: Source = .{ .{ .name = "Clmg", .value = .{ .string = "\\E[s" } }, .{ .name = "Cmg", .value = .{ .string = "\\E[%i%p1%d;%p2%ds" } }, + // Clear screen. E3 is the extension to clear scrollback + .{ .name = "clear", .value = .{ .string = "\\E[H\\E[2J" } }, + .{ .name = "E3", .value = .{ .string = "\\E[3J" } }, + // These are all capabilities that should be pretty straightforward // and map to input sequences. .{ .name = "bel", .value = .{ .string = "^G" } }, @@ -154,7 +158,6 @@ pub const ghostty: Source = .{ .{ .name = "bold", .value = .{ .string = "\\E[1m" } }, .{ .name = "cbt", .value = .{ .string = "\\E[Z" } }, .{ .name = "civis", .value = .{ .string = "\\E[?25l" } }, - .{ .name = "clear", .value = .{ .string = "\\E[H\\E[2J" } }, .{ .name = "cnorm", .value = .{ .string = "\\E[?12l\\E[?25h" } }, .{ .name = "cr", .value = .{ .string = "\\r" } }, .{ .name = "csr", .value = .{ .string = "\\E[%i%p1%d;%p2%dr" } },