Open cefn opened 6 years ago
colorama
tries to provide facilities to make colorful command line programs portable and only supports a small set of other escape codes. A bigger problem also that it uses regexp to identify escape sequences and thus can not handle cases where it receives the data char by char (as it may happen when receiving from the serial port, there is a hack in mpy_miniterm because of that). So it is not perfect for emulation a terminal... Though it works fine for its intended use case.
I think it would be good to make ma proper terminal with escape handling in pySerial, so that the control sequences can be handled e.g. by Windows API calls (as colorama
does) or by other "renderers" such as a wxPython widget or so. But that should be done in a separate project and not within miniterm. Otherwise it can not be called "mini" anymore ;-) and one purpose of miniterm is to debug serial connections so it should be simple and consistent across platforms (that's why it now also filters escape sequences on systems where they would work).
Hi there,
I have successfully used there to connect to my Micropython board ( https://vgkits.org/blog/2018/05/08/introductory-video-tutorial/ ) but while I think it's doing everything correctly under the hood, I find that the character grid in CMD.exe is not being updated to reflect deletion.
For example, if I type the word 'hello' into the Micropython prompt, then delete three characters, the cursor goes backwards until it's under the first 'l', but all the 'llo' letters remain visible. The same applies to the behaviour of delete. The remaining characters are redrawn one position to the left, but the disappearing character on the far right is never deleted.
When I press enter I get the reassuring indication that actually the 'llo' were in fact removed (the backspace key logic works) but the 'llo' was never removed from the local visual buffer...
Is this an issue which should properly be filed with colorama, assuming that the proper bytes are being received from the serial link, but that it is not updating the character grid properly for the ANSI codes? I am struggling to unpack the layers here and know which part is responsible for which.
Backspace
(Forward) Deletion