-multiline +restart on ctrl_c

This commit is contained in:
Данила Горнушко 2023-11-28 10:08:40 +03:00
parent 6cb2ec72c3
commit 901c077207

View file

@ -128,8 +128,9 @@ void console_task_interactive(void* arg) {
linenoiseEditStart(&ls); linenoiseEditStart(&ls);
} }
ESP_LOGE(TAG, "Terminating console"); ESP_LOGE(TAG, "Restarting...");
esp_console_deinit(); esp_console_deinit();
esp_restart();
while (1) { while (1) {
vTaskDelay(100); vTaskDelay(100);
} }
@ -157,7 +158,7 @@ void initialize_console(void) {
// linenoiseSetMultiLine(1); // linenoiseSetMultiLine(1);
linenoiseSetCompletionCallback(&esp_console_get_completion); linenoiseSetCompletionCallback(&esp_console_get_completion);
linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint); linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint);
linenoiseHistorySetMaxLen(100); linenoiseHistorySetMaxLen(30);
linenoiseSetMaxLineLen(console_config.max_cmdline_length); linenoiseSetMaxLineLen(console_config.max_cmdline_length);
linenoiseHistoryLoad(HISTORY_PATH); linenoiseHistoryLoad(HISTORY_PATH);
/* Register commands */ /* Register commands */