From 7e9cfd497fe1869f008baa1f6edd5d9a2edee017 Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Wed, 12 Aug 2015 15:28:19 +0200 Subject: miniterm: tweak filters (allow BS, TAB) --- serial/tools/miniterm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serial/tools/miniterm.py b/serial/tools/miniterm.py index 111748a..9c6b4fb 100644 --- a/serial/tools/miniterm.py +++ b/serial/tools/miniterm.py @@ -213,7 +213,7 @@ class LF(Transform): class NoTerminal(Transform): """remove typical terminal control codes from input""" def input(self, text): - return ''.join(t if t >= ' ' or t in '\r\n' else unichr(0x2400 + ord(t)) for t in text) + return ''.join(t if t >= ' ' or t in '\r\n\b\t' else unichr(0x2400 + ord(t)) for t in text) echo = input @@ -235,11 +235,11 @@ class HexDump(Transform): class Printable(Transform): - """Show decimal code for all non-ASCII characters and control codes""" + """Show decimal code for all non-ASCII characters and most control codes""" def input(self, text): r = [] for t in text: - if ' ' <= t < '\x7f' or t in '\r\n': + if ' ' <= t < '\x7f' or t in '\r\n\b\t': r.append(t) else: r.extend(unichr(0x2080 + ord(d) - 48) for d in '{:d}'.format(ord(t))) -- cgit v1.2.1