diff options
| author | Jonas Scharpf <jonas@brainelectronics.de> | 2023-04-05 07:48:53 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-04-15 00:07:40 +1000 |
| commit | b525f1c9ec8ffa9009754578932f3fad5f63026b (patch) | |
| tree | fd98163a8a8e9b7cbfc2396e8441ab86e643502a | |
| parent | 0acc73344a38cb04eb014bbf68aba31135ceff47 (diff) | |
tools/mpremote: Add ctrl-x as additonal mpremote disconnect shortcut.
The mpremote REPL can now be closed with either ctrl+] or ctrl+x, which
gives users a choice, useful if the ']' key is difficult to access.
Fixes issue #11197.
Signed-off-by: Jonas Scharpf <jonas@brainelectronics.de>
| -rw-r--r-- | tools/mpremote/mpremote/repl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/mpremote/mpremote/repl.py b/tools/mpremote/mpremote/repl.py index 3d6ca1881..d5eb2b871 100644 --- a/tools/mpremote/mpremote/repl.py +++ b/tools/mpremote/mpremote/repl.py @@ -8,7 +8,7 @@ def do_repl_main_loop(state, console_in, console_out_write, *, code_to_inject, f console_in.waitchar(state.pyb.serial) c = console_in.readchar() if c: - if c == b"\x1d": # ctrl-], quit + if c in (b"\x1d", b"\x18"): # ctrl-] or ctrl-x, quit break elif c == b"\x04": # ctrl-D # special handling needed for ctrl-D if filesystem is mounted @@ -56,7 +56,7 @@ def do_repl(state, args): file_to_inject = args.inject_file print("Connected to MicroPython at %s" % state.pyb.device_name) - print("Use Ctrl-] to exit this shell") + print("Use Ctrl-] or Ctrl-x to exit this shell") if capture_file is not None: print('Capturing session to file "%s"' % capture_file) capture_file = open(capture_file, "wb") |
