After setting platformio.ini
…
monitor_filters = colorize, log2file
…
I got this:
(67434) J2S: Body read binaryFileLengtn 987115
[0;32mI (67452) J2S: Body read binaryFileLengtn 987970
[0;32mI (67472) J2S: Body read binaryFileLengtn 988995
I (67492) J2S: Body read binaryFileLengtn 990020
[0;32mI (67512) J2S: Body read binaryFileLengtn 991045
I (67530) J2S: Body read binaryFileLengtn 992070
I (67549) J2S: Body read binaryFileLengtn 993095
[0;32mI (67562) J2S: Body read binaryFileLengtn 993730
I (67582) J2S: Body read binaryFileLengtn 994755
Some lines are Ok with colors, others still get the ANSI esc.
Of course, before the monitor_filters I got always the Esc chars.
At first I was going to say I think that colorize doesn’t do what you think it does… according to the docs:
Apply different colors for received and echo
… but, now that I’ve gotten it to mostly consistently colour print, it does actually do the ANSI colour code colours also!
Anyway, I was thinking there was nothing about ANSI colour codes there. Looking at the list of possible filters, printable sounds closer, but isn’t. I only had luck using monitor_filters = direct or monitor_flags = --raw, but that still broke after a couple of lines. For some weird reason, since it looked like the escape character itself was been eaten, I put a space before it, and now it consistently colour prints (using the direct or colorize filter).
I know this isn’t the ESP-IDF, but the issue appears to be in the monitor, not the framework used. AS you can see, something goofy happened on the second line of the program, with the indent, and then it was fine after that.
Please fill free to draw your attention to other matters that do not enable to work with Platformio.
This is a minor problem. I am working even with this view!!!
Hm… that is looking exactly the same as mine was… the line before it plays up, there is a gap, almost as if the monitor thought there was a \t tab character, and then the next line looks like the esc character was dropped, thus losing the formatting. Your output it least recovered on the next line… mine stayed broken from then onwards.
In your output routine, are you able to put a space, or some other character before the esc character/code? As that is what has settled mine down. It’s as if sometimes it just drops the leading character from the line, which happens to be the esc character.
I thanks for your suggestion.
I will do it next time.
It is not the most important feature.
Does not cause any trouble, but, of course it will be nice.
The lack of the possibility to send commands via terminal it was more important.
I have to use a third part one but it is not the best!
Thanks again for your suggestion.
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
Error: 'raw'
The terminal process "C:\Users\kimchips\.platformio\penv\Scripts\platformio.exe 'device', 'monitor'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
For those with win 10 and just scrolled to the end, this is what I did.
@Thomseeen mentions steps, but this is a slightly shorten version.
Change your powershell to support ansi encoding globally by running in power shell: Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1
See this link for alternatives to this “global” change, here
Add this line/setting to you platformio.ini file: monitor_raw=yes