Skip to content

Commit

Permalink
dist/tools/pyterm: fix handling of reset ANSI escape code
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Sep 9, 2019
1 parent 04d3397 commit 9ea3b2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/tools/pyterm/pyterm
Expand Up @@ -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'

Expand Down

0 comments on commit 9ea3b2e

Please sign in to comment.