selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
653 stars 101 forks source link

Handling of character set switching in UTF-8 mode #88

Closed tspivey closed 7 years ago

tspivey commented 7 years ago

With pyte 0.6.0, the following code just leaves a B on the terminal display:

import pyte
screen = pyte.Screen(80, 24)
stream = pyte.Stream()
stream.attach(screen)
stream.feed('\x1b(B')
print(screen.display[0].strip())

Reading the code (and the associated FAQ entry), it says that the escape sequence should be ignored. The code ignores it by not reading the last character.

However, if I run lynx in my shell (TERM=xterm, LANG=en_US.UTF-8), this sequence is sent quite a bit, leaving B in my terminal.

superbobry commented 7 years ago

Hi Tyler. Thanks for the bug report, it should've been fixed in master. Could you give it a try and let me know if it works for you?

tspivey commented 7 years ago

It's working. Thanks for the fix.