Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated character escape sequence not handled #184

Open
Moult opened this issue Dec 11, 2024 · 0 comments
Open

Repeated character escape sequence not handled #184

Moult opened this issue Dec 11, 2024 · 0 comments

Comments

@Moult
Copy link
Contributor

Moult commented Dec 11, 2024

Given this fed into a stream:

a\x1b[4b

This means that the a character should be releated 4 times. However this does not seem to be handled by pyte. See the documentation on this website:

CSI Ps b  Repeat the preceding graphic character Ps times (REP).

Expected behaviour: aaaaa
Actual behaviour: a

Sample code to reproduce:

import pyte
screen = pyte.Screen(30, 1)
stream = pyte.Stream(screen)
data = b'a\x1b[4b'
stream.feed(data.decode('cp437'))
for y, row in screen.buffer.items():
    for x, cell in row.items():
        print(x, cell.data, cell.fg, cell.bg, cell.bold, "reversed" if cell.reverse else "")

import sys
sys.stdout.write(data.decode('cp437')) # will give aaaaa

This will output:

0 a default default False 
aaaaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant