mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
Merge pull request #1609 from gpanders/kitty-alt-reset
terminal: reset alt screen kitty keyboard state on full reset
This commit is contained in:
@ -2368,6 +2368,7 @@ pub fn fullReset(self: *Terminal) void {
|
|||||||
self.tabstops.reset(TABSTOP_INTERVAL);
|
self.tabstops.reset(TABSTOP_INTERVAL);
|
||||||
self.screen.clearSelection();
|
self.screen.clearSelection();
|
||||||
self.screen.kitty_keyboard = .{};
|
self.screen.kitty_keyboard = .{};
|
||||||
|
self.secondary_screen.kitty_keyboard = .{};
|
||||||
self.screen.protected_mode = .off;
|
self.screen.protected_mode = .off;
|
||||||
self.scrolling_region = .{
|
self.scrolling_region = .{
|
||||||
.top = 0,
|
.top = 0,
|
||||||
@ -8226,6 +8227,25 @@ test "Terminal: fullReset status display" {
|
|||||||
try testing.expect(t.status_display == .main);
|
try testing.expect(t.status_display == .main);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/mitchellh/ghostty/issues/1607
|
||||||
|
test "Terminal: fullReset clears alt screen kitty keyboard state" {
|
||||||
|
var t = try init(testing.allocator, .{ .cols = 10, .rows = 10 });
|
||||||
|
defer t.deinit(testing.allocator);
|
||||||
|
|
||||||
|
t.alternateScreen(.{});
|
||||||
|
t.screen.kitty_keyboard.push(.{
|
||||||
|
.disambiguate = true,
|
||||||
|
.report_events = false,
|
||||||
|
.report_alternates = true,
|
||||||
|
.report_all = true,
|
||||||
|
.report_associated = true,
|
||||||
|
});
|
||||||
|
t.primaryScreen(.{});
|
||||||
|
|
||||||
|
t.fullReset();
|
||||||
|
try testing.expectEqual(0, t.secondary_screen.kitty_keyboard.current().int());
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/mitchellh/ghostty/issues/272
|
// https://github.com/mitchellh/ghostty/issues/272
|
||||||
// This is also tested in depth in screen resize tests but I want to keep
|
// This is also tested in depth in screen resize tests but I want to keep
|
||||||
// this test around to ensure we don't regress at multiple layers.
|
// this test around to ensure we don't regress at multiple layers.
|
||||||
|
Reference in New Issue
Block a user