Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pyocd/subcommands/rtt_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def get_args(cls) -> List[argparse.ArgumentParser]:
help="Down channel ID.")
rtt_options.add_argument("-d", "--log-file", type=str, default=None,
help="Log file name. When specified, logging mode is enabled.")
rtt_options.add_argument("--echo", action=argparse.BooleanOptionalAction, default=True,
help="Echo locally typed characters. By default echo is on.")

return [cls.CommonOptions.COMMON, cls.CommonOptions.CONNECT, rtt_parser]

Expand Down Expand Up @@ -191,8 +193,9 @@ def viewer_loop(self, up_chan, down_chan, kb):

if ord(c) == 27: # process ESC
break
elif c.isprintable() or c == '\n':
print(c, end="", flush=True)
if self._args.echo:
if c.isprintable() or c == '\n':
print(c, end="", flush=True)

# add char to buffer
cmd += c.encode("utf-8")
Expand Down
Loading