1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

dist/tools/pyterm: fix handling of reset ANSI escape code

This commit is contained in:
Alexandre Abadie 2019-05-23 13:59:32 +02:00
parent 04d33973f4
commit 9ea3b2e04f
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -665,6 +665,14 @@ class SerCmd(cmd.Cmd):
else:
output += c
# Hack to correctly handle reset ANSI escape code in the stream
# When the reset escape sequence is detected, it is written and
# flushed immediately to stdout
if output == '\033[0m':
sys.stdout.write(output)
sys.stdout.flush()
output = ""
crreceived = c == '\r'
nlreceived = c == '\n'