mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-21 20:34:19 +00:00
xterm audit: DECOM (origin mode)
This commit is contained in:
@@ -2170,6 +2170,20 @@ test "Terminal: fullReset with a non-empty pen" {
|
||||
try testing.expect(cell.fg.eql(.{}));
|
||||
}
|
||||
|
||||
test "Terminal: fullReset origin mode" {
|
||||
var t = try init(testing.allocator, 10, 10);
|
||||
defer t.deinit(testing.allocator);
|
||||
|
||||
t.setCursorPos(3, 5);
|
||||
t.modes.set(.origin, true);
|
||||
t.fullReset(testing.allocator);
|
||||
|
||||
// Origin mode should be reset and the cursor should be moved
|
||||
try testing.expectEqual(@as(usize, 0), t.screen.cursor.y);
|
||||
try testing.expectEqual(@as(usize, 0), t.screen.cursor.x);
|
||||
try testing.expect(!t.modes.get(.origin));
|
||||
}
|
||||
|
||||
test "Terminal: input with no control characters" {
|
||||
var t = try init(testing.allocator, 80, 80);
|
||||
defer t.deinit(testing.allocator);
|
||||
|
||||
@@ -1749,7 +1749,9 @@ const StreamHandler = struct {
|
||||
// Schedule a render since we changed colors
|
||||
.reverse_colors => try self.queueRender(),
|
||||
|
||||
// Origin resets cursor pos
|
||||
// Origin resets cursor pos. This is called whether or not
|
||||
// we're enabling or disabling origin mode and whether or
|
||||
// not the value changed.
|
||||
.origin => self.terminal.setCursorPos(1, 1),
|
||||
|
||||
.enable_left_and_right_margin => if (!enabled) {
|
||||
|
||||
Reference in New Issue
Block a user