Merge pull request #1491 from gpanders/reset-status-display

Reset status display after a full reset
This commit is contained in:
Mitchell Hashimoto
2024-02-09 14:12:53 -08:00
committed by GitHub

View File

@ -2186,6 +2186,7 @@ pub fn fullReset(self: *Terminal, alloc: Allocator) void {
self.eraseDisplay(alloc, .scrollback, false);
self.eraseDisplay(alloc, .complete, false);
self.pwd.clearRetainingCapacity();
self.status_display = .main;
}
test "Terminal: fullReset with a non-empty pen" {
@ -2215,6 +2216,15 @@ test "Terminal: fullReset origin mode" {
try testing.expect(!t.modes.get(.origin));
}
test "Terminal: fullReset status display" {
var t = try init(testing.allocator, 10, 10);
defer t.deinit(testing.allocator);
t.status_display = .status_line;
t.fullReset(testing.allocator);
try testing.expect(t.status_display == .main);
}
test "Terminal: input with no control characters" {
var t = try init(testing.allocator, 80, 80);
defer t.deinit(testing.allocator);