diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index 86f9f37e6..fe1bbc2d3 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -714,6 +714,11 @@ test "Terminal: setScrollingRegion" { t.setScrollingRegion(7, 3); try testing.expectEqual(@as(usize, 0), t.scrolling_region.top); try testing.expectEqual(@as(usize, t.rows - 1), t.scrolling_region.bottom); + + // Scroll region with zero top and bottom + t.setScrollingRegion(0, 0); + try testing.expectEqual(@as(usize, 0), t.scrolling_region.top); + try testing.expectEqual(@as(usize, t.rows - 1), t.scrolling_region.bottom); } test "Terminal: deleteLines" { diff --git a/src/terminal/stream.zig b/src/terminal/stream.zig index ba262a52f..06c9ecd56 100644 --- a/src/terminal/stream.zig +++ b/src/terminal/stream.zig @@ -327,6 +327,7 @@ pub fn Stream(comptime Handler: type) type { // DECSTBM - Set Top and Bottom Margins // TODO: test 'r' => if (@hasDecl(T, "setTopAndBottomMargin")) switch (action.params.len) { + 0 => try self.handler.setTopAndBottomMargin(0, 0), 1 => try self.handler.setTopAndBottomMargin(action.params[0], 0), 2 => try self.handler.setTopAndBottomMargin(action.params[0], action.params[1]), else => log.warn("invalid DECSTBM command: {}", .{action}),