Closed codefreax closed 4 years ago
This looks good, thanks! I only have a small documentation comment.
Testing:
mpfs [/]> md foo
mpfs [/]> cd foo
mpfs [/foo]> repl
>
*** Exit REPL with Ctrl+] ***
MicroPython v1.12-124-g4a18ea439 on 2020-02-02; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>> import os
>>> os.getcwd()
'/'
>>> os.listdir('/')
['boot.py', 'foo']
>>> os.rmdir('/foo')
>>> os.listdir('/')
['boot.py']
>>>
No such directory: /foo
mpfs [/]>
Looks great, thank you!
Without these changes, mpfshell returns to the fs root, i.e. /, when returning from REPL, but still displays the original path from before REPL in the prompt. One commit makes sure the correct path is displayed in the prompt when returning from REPL. The other commit restores the path from before REPL, if it still exists.