selectel / pyte

Simple VTXXX-compatible linux terminal emulator

Home Page:http://pyte.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

screem.display not correct when feed data has many '\x1b[C' chars

JJJJJJJJames opened this issue · comments

First type some short command, then type a long command, then use up and down or page up and page down key, server will send back stream characters with many '\x1b[C' chars, feed those data and call screen.display, the result is not correct.

Could you provide a reproducer please? Are you driving the Screen manually or from a pty?

From pty.

I have below output, use debug screen,last command is ["draw", ["eeeeee"], {}], but when I print the screen.display, the result is cccccccccccccccccccccccccccccccceeeeee

output:
'eeeeee\x08\x08\x08\x08\x08\x08qqqqqqqq\x08\x08\x08\x08\x08\x08\x08\x08\x1b[2Peeeeee\x08\x08\x08\x08\x08\x08ccccccc\x08\x08\x08\x08\x08\x08\x08aaaaaaa\x08\x08\x08\x08\x08\x08\x08ccccccccccccccccccccccccccccccccccccccccccc\r\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[Ceeeeeeeeeee\x1b[K\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x1b[2Pddddddddd\x08\x08\x08\x08\x08\x08\x08\x08\x08ccccccccccc\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x1b[2Pddddddddd\x08\x08\x08\x08\x08\x08\x08\x08\x08eeeeeeeeeee\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08ccccccccccccccccccccccccccccccccccccccccccc\r\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[C\x1b[Caaaaaaa\x1b[K\x08\x08\x08\x08\x08\x08\x08ccccccc\x08\x08\x08\x08\x08\x08\x08\x1b[1Peeeeee'