Pull changes from to console/min
@@ -171,6 +171,7 @@ console_handle_char(uint8_t byte)
static struct os_event *ev;
static struct console_input *input;
+ static char prev_endl = '\0';
if (!avail_queue || !lines_queue) {
return 0;
@@ -228,6 +229,14 @@ console_handle_char(uint8_t byte)
nlip_state |= NLIP_DATA_START1;
break;
case '\r':
+ /* Falls through. */
+ case '\n':
+ if (byte == '\n' && prev_endl == '\r') {
+ /* handle double end line chars */
+ prev_endl = byte;
+ break;
+ }
+ prev_endl = byte;
input->line[cur + end] = '\0';
console_out('\r');
console_out('\n');
@@ -244,7 +253,15 @@ console_handle_char(uint8_t byte)
input = NULL;
ev = NULL;
break;
+ case '\t':
+ if (completion && !end) {
+ console_blocking_mode();
+ completion(input->line, console_append_char);
+ console_non_blocking_mode();
+ }
+ break;
default:
+ insert_char(&input->line[cur], byte, end);
break;
}
