Allow parameter less CSI sequences

This commit is contained in:
Kovid Goyal
2016-11-16 19:53:38 +05:30
parent d0c2821339
commit 745ba5c4cb
4 changed files with 69 additions and 16 deletions

View File

@@ -63,6 +63,14 @@ class TestScreen(BaseTest):
s.cursor_back(5)
pb('x\033[2@y', ('screen_insert_characters', 2))
self.ae(str(s.line(0)), 'xy bc')
pb('x\033[2;3@y', ('screen_insert_characters', 2))
pb('x\033[@y', 'Invalid first character for CSI: 0x%x' % ord('@'))
pb('x\033[2;7@y', ('screen_insert_characters', 2))
pb('x\033[@y', ('screen_insert_characters', 1))
pb('x\033[345@y', ('screen_insert_characters', 345))
pb('x\033[345;@y', ('screen_insert_characters', 345))
pb('\033[H', ('screen_cursor_position', 1, 1))
self.ae(s.cursor.x, 0), self.ae(s.cursor.y, 0)
pb('\033[4H', ('screen_cursor_position', 4, 1))
pb('\033[3;2H', ('screen_cursor_position', 3, 2))
pb('\033[3;2;H', ('screen_cursor_position', 3, 2))
self.ae(s.cursor.x, 1), self.ae(s.cursor.y, 2)
s.reset()