Skip to content

Commit

Permalink
tools/mpremote: Add ctrl-x as additonal mpremote disconnect shortcut.
Browse files Browse the repository at this point in the history
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 micropython#11197.

Signed-off-by: Jonas Scharpf <[email protected]>
  • Loading branch information
brainelectronics authored and dpgeorge committed Apr 14, 2023
1 parent 0acc733 commit b525f1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/mpremote/mpremote/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b525f1c

Please sign in to comment.