Skip to content

Repeated character escape sequence not handled #184

Description

@Moult

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions