Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyte/escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,5 @@
DECSTBM = "r"

#: *Horizontal position adjust*: Same as :data:`CHA`.
HPA = "'"
HPA = "`"

28 changes: 28 additions & 0 deletions tests/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,31 @@ def test_byte_stream_select_other_charset():
# c) enable utf-8
stream.select_other_charset("G")
assert stream.use_utf8


def test_csi_cha():
screen = pyte.Screen(10, 2)
stream = pyte.Stream(screen)
# before
assert screen.cursor.x == 0
assert screen.cursor.y == 0
assert screen.display[0] == " "
# set cursor to column absolute
stream.feed("\x9b4`text")
assert screen.cursor.x == 7
assert screen.cursor.y == 0
assert screen.display[0] == " text "


def test_csi_hpa():
screen = pyte.Screen(10, 2)
stream = pyte.Stream(screen)
# before
assert screen.cursor.x == 0
assert screen.cursor.y == 0
assert screen.display[0] == " "
# set cursor to column absolute
stream.feed("\x9b4`text")
assert screen.cursor.x == 7
assert screen.cursor.y == 0
assert screen.display[0] == " text "