add support for buffer switching with CSI ? 47 h/l

pull/7443/head
Jonatan Borkowski 2025-05-25 22:22:07 +02:00 committed by Mitchell Hashimoto
parent d72a1511fe
commit 21c97aa9d6
2 changed files with 11 additions and 0 deletions

View File

@ -206,6 +206,7 @@ const entries: []const ModeEntry = &.{
.{ .name = "cursor_visible", .value = 25, .default = true },
.{ .name = "enable_mode_3", .value = 40 },
.{ .name = "reverse_wrap", .value = 45 },
.{ .name = "alt_screen_legacy", .value = 47 },
.{ .name = "keypad_keys", .value = 66 },
.{ .name = "enable_left_and_right_margin", .value = 69 },
.{ .name = "mouse_event_normal", .value = 1000 },

View File

@ -582,6 +582,16 @@ pub const StreamHandler = struct {
self.terminal.scrolling_region.right = self.terminal.cols - 1;
},
.alt_screen_legacy => {
if (enabled)
self.terminal.alternateScreen(.{})
else
self.terminal.primaryScreen(.{});
// Schedule a render since we changed screens
try self.queueRender();
},
.alt_screen => {
const opts: terminal.Terminal.AlternateScreenOptions = .{
.cursor_save = false,