tools/mpremote: Add repl option to escape non-printable characters.

This commit adds the "--escape-non-printable" option to the repl command.
When specified the REPL console will escape non-printable characters,
printing them as their hex value in square brackets.

This escaping behaviour was previously the default and only behaviour, but
it is now opt-in.

As part of this change, the speed of echoing device data to the console is
improved by by reading and writing in chunks.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-05-11 13:24:14 +10:00
parent a802f71908
commit 2771b20d29
3 changed files with 21 additions and 8 deletions

View File

@@ -92,6 +92,7 @@ The full list of supported commands are:
Options are:
- ``--escape-non-printable``, to print non-printable bytes/characters as their hex code
- ``--capture <file>``, to capture output of the REPL session to the given
file
- ``--inject-code <string>``, to specify characters to inject at the REPL when