Dont allow CUB to move cursor onto previous line

Reserve this behavior for actual backspace. Fixes #8900
This commit is contained in:
Kovid Goyal
2025-08-14 21:48:22 +05:30
parent c8c0201cbb
commit a0b58ef205
4 changed files with 13 additions and 7 deletions

View File

@@ -555,6 +555,12 @@ class TestScreen(BaseTest):
backspace(use_bs)
self.ae(str(s.line(0)), q[:-1] + ' ')
self.ae(str(s.line(1)), ' ')
# Test that CUB does not move cursor onto previous line
s.reset()
s.draw('a'*s.columns + 'b')
self.ae((s.cursor.x, s.cursor.y), (1, 1))
parse_bytes(s, b'\x1b[100D')
self.ae((s.cursor.x, s.cursor.y), (0, 1))
def test_margins(self):
# Taken from vttest/main.c