Skip to content

Commit 18df478

Browse files
committed
Move at least 1 columns, for CSI 0 C and CSI 0 D
1 parent 4b46d30 commit 18df478

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

entry/src/main/cpp/terminal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,11 @@ void terminal_context::HandleCSI(uint8_t current) {
326326
}
327327
} else if (current == 'C') {
328328
// CSI Ps C, CUF, move cursor right # columns
329-
col += read_int_or_default(1);
329+
col += std::max(read_int_or_default(1), 1);
330330
ClampCursor();
331331
} else if (current == 'D') {
332332
// CSI Ps D, CUB, move cursor left # columns
333-
col -= read_int_or_default(1);
333+
col -= std::max(read_int_or_default(1), 1);
334334
ClampCursor();
335335
} else if (current == 'E') {
336336
// CSI Ps E, CNL, move cursor to the beginning of next line, down # lines

0 commit comments

Comments
 (0)