<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I'm still on v2.1... Good thing to watch out for, however.<br>
<br>
Greg<br><br><div class="gmail_quote">On January 11, 2018 9:51:32 PM PST, Mark Webb-Johnson <mark@webb-johnson.net> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Maybe the recent change for IDF v3 where Espressif messed around with CRLF.<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">2f0c9f0 Translate CR or CRLF to LF on async console for microrl</div><div class=""><br class=""></div><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">$ git diff fc69e3e 2f0c9f0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">diff --git a/vehicle/OVMS.V3/main/console_async.cpp b/vehicle/OVMS.V3/main/console_async.cpp</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">index e7110fa..dd3df4a 100644</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">--- a/vehicle/OVMS.V3/main/console_async.cpp</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+++ b/vehicle/OVMS.V3/main/console_async.cpp</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">@@ -155,6 +155,24 @@ void ConsoleAsync::HandleDeviceEvent(void* pEvent)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> if (buffered_size > 0)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> {</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> int len = uart_read_bytes(EX_UART_NUM, data, BUF_SIZE, 100 / portTICK_RATE_MS);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ // Translate CR (Enter) from montitor into \n for microrl</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ bool found = false;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ for (int i = 0; i < len; ++i)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ {</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ if (found && data[i] == '\n')</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ {</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ for (int j = i+1; j < len; ++j)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ data[j-1] = data[j];</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ --len;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ continue;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ }</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ found = false;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ if (data[i] == '\r')</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ {</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ data[i] = '\n';</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ found = true;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ }</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ }</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> ProcessChars((char*)data, len);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> }</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> break;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">@@ -171,7 +189,7 @@ void ConsoleAsync::HandleDeviceEvent(void* pEvent)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> uart_flush(EX_UART_NUM);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> break;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> default:</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">- ESP_LOGI(TAG, "uart event type: %d\n", event.type);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ ESP_LOGE(TAG, "uart event type: %d", event.type);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> break;</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> }</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> }</span></font></div></div></blockquote><div class=""><div><br class=""></div><div>That should only affect the ASYNC console, I think. It converts CR/LF/CRLF -> LF. Maybe the enum KEY_ACTION in openemacs (vfsedit component) needs to change?</div><div><br class=""></div><div>Fix is probably to add a NL=10 to KEY_ACTION and then to treat NL or ENTER as the same in the editor_process_keypress. My build environment is all switched to v3 at the moment, so hard for me to test (as IDF v3 does things differently). I’ve made the fix in the for-master branch, and it seems to work for me.</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">$ git diff --staged</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">--- a/vehicle/OVMS.V3/components/vfsedit/src/openemacs.c</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+++ b/vehicle/OVMS.V3/components/vfsedit/src/openemacs.c</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">@@ -71,7 +71,7 @@ struct append_buffer</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> enum KEY_ACTION</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> {</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> CTRL_A = 1, CTRL_B = 2, CTRL_C = 3, CTRL_D = 4, CTRL_E = 5, CTRL_F = 6, BACKSPACE = 8, TAB = 9,</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">- CTRL_K = 11, CTRL_L = 12, ENTER = 13, CTRL_N = 14, CTRL_P = 16, CTRL_Q = 17, CTRL_R = 18,</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ NL = 10, CTRL_K = 11, CTRL_L = 12, ENTER = 13, CTRL_N = 14, CTRL_P = 16, CTRL_Q = 17, CTRL_R = 18,</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> CTRL_S = 19, CTRL_U = 21, CTRL_V = 22, CTRL_X = 24, CTRL_Y = 25, CTRL_Z = 26, ESC = 27,</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> FORWARD_DELETE = 127,</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> // The following are just soft codes, not really reported by the</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">@@ -1297,7 +1297,7 @@ bool editor_process_keypress(struct editor_state* E, int k)</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> // Quoted insert - insert character as-is</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> editor_insert_char(E,key);</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> }</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">- else if (key == ENTER)</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">+ else if (key == ENTER || key == NL)</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> {</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> editor_insert_newline(E);</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> }</span></font></div></div></blockquote><div class=""><div><br class=""></div><div>I just made the fix also in the master branch, but haven’t tested.</div><div><br class=""></div><div>Regards, Mark.</div><div><br class=""><blockquote type="cite" class=""><div class="">On 12 Jan 2018, at 1:36 PM, Greg D. <<a href="mailto:gregd2350@gmail.com" class="">gregd2350@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Is anyone else having trouble with the vfs editor? I can't seem to<br class="">enter a newline anymore. The status line at the bottom complains of an<br class="">unknown command 10 (presumably control-J). If I try an explicit<br class="">control-M, it says the same.<br class=""><br class="">Did I fat-finger something in my config (I removed SSH, Telnet, and<br class="">several other items to save RAM recently), or did something else<br class="">change? This is with two different terminals - make monitor on the<br class="">development laptop, and putty on my in-car Raspberry Pi.<br class=""><br class="">Greg<br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.teslaclub.hk" class="">OvmsDev@lists.teslaclub.hk</a><br class="">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>