Skip to content

Support for DEC special graphics #182

Description

@Moult

This is used in the majority of Nethack ttyrecs. There's a thing called https://en.wikipedia.org/wiki/DEC_Special_Graphics where if \e(0 is sent, it toggles some codes.

Steps to reproduce:

import pyte
screen = pyte.Screen(30, 1)
stream = pyte.Stream(screen)
data = b'x\x1b(0x\x1b(Bx'
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'))

Expected: x|x
Actual: xxx

Sample code produces:

0 x default default False 
1 x default default False 
2 x default default False 
x│x

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