From 2fcd93cdd0cf33a83346eb4a6ed47ec1404a985b Mon Sep 17 00:00:00 2001 From: Tobias Thyrrestrup Date: Fri, 14 Oct 2022 09:16:44 +0200 Subject: [PATCH] tools/mpremote: Allow EDITOR environment variable to work on Windows. --- tools/mpremote/mpremote/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mpremote/mpremote/commands.py b/tools/mpremote/mpremote/commands.py index 558cd82f10..3bd8732bd0 100644 --- a/tools/mpremote/mpremote/commands.py +++ b/tools/mpremote/mpremote/commands.py @@ -174,7 +174,7 @@ def do_edit(state, args): os.close(dest_fd) state.pyb.fs_touch(src) state.pyb.fs_get(src, dest, progress_callback=show_progress_bar) - if os.system("$EDITOR '%s'" % (dest,)) == 0: + if os.system('%s "%s"' % (os.getenv("EDITOR"), dest)) == 0: state.pyb.fs_put(dest, src, progress_callback=show_progress_bar) finally: os.unlink(dest)