widgets(terminal): implement CSI D

This commit is contained in:
Tim Culverhouse 2024-06-09 20:30:21 -05:00
parent 21f2a48a80
commit cc77c98d32

View file

@ -281,6 +281,22 @@ fn run(self: *Terminal) !void {
self.back_screen.width,
);
},
'D' => {
self.back_screen.cursor.pending_wrap = false;
var iter = seq.iterator(u16);
const delta = iter.next() orelse 1;
const within = self.back_screen.withinScrollingRegion();
if (within)
self.back_screen.cursor.col = @max(
self.back_screen.cursor.col -| delta,
self.back_screen.scrolling_region.left,
)
else
self.back_screen.cursor.col = @max(
self.back_screen.cursor.col -| delta,
0,
);
},
'H', 'f' => { // CUP
var iter = seq.iterator(u16);
const row = iter.next() orelse 1;