dhylands / rshell

Remote Shell for MicroPython
MIT License
955 stars 137 forks source link

Tab Completion Crashes -- Sometimes #236

Open thestumbler opened 2 months ago

thestumbler commented 2 months ago

Just an observation... using tab completion causes rshell to crash on me about 50% of the time. I don't see any rhyme or reason to the crashes, it appears to be random.

/Users/rclott/root/files/projs/buspirate5/flash> cp main.py /pyboard

I pressed the TAB key somewhere in text pyboard. The fact that I see pyboard completely spelled out means that TAB completion actually did its thing. But the exception was for another reason.

Traceback (most recent call last):
  File "/Users/rclott/root/files/projs/buspirate5/.venv/lib/python3.9/site-packages/rshell/main.py", line 2043, in filename_complete
    return self.real_filename_complete(text, line, begidx, endidx)
  File "/Users/rclott/root/files/projs/buspirate5/.venv/lib/python3.9/site-packages/rshell/main.py", line 2120, in real_filename_complete
    paths = sorted(auto(listdir_matches, abs_match))
  File "/Users/rclott/root/files/projs/buspirate5/.venv/lib/python3.9/site-packages/rshell/main.py", line 618, in auto
    return dev.remote_eval(func, dev_filename, *args, **kwargs)
  File "/Users/rclott/root/files/projs/buspirate5/.venv/lib/python3.9/site-packages/rshell/main.py", line 1679, in remote_eval
    return eval(self.remote(func, *args, **kwargs))
  File "<string>", line 0

SyntaxError: unexpected EOF while parsing

This issue is not super important -- it's more of a curiosity. When I get too annoyed typing out the full paths for the cp command, I will just run the following command, which gets all the files needing to be updated in one fell swoop.

rshell rsync . /pyboard && rshell

I also have observed the CTRL-P recall command function still works on my system when running rshell, and that is also a great keypress saver. For example,

cp lib/b <CTRL-P>

will pop up the last matching command, for example:

cp lib/buspirate.py /pyboard/lib