diff --git a/components/console/esp_console_repl.c b/components/console/esp_console_repl.c index 772de2e825..09929931b5 100644 --- a/components/console/esp_console_repl.c +++ b/components/console/esp_console_repl.c @@ -368,6 +368,8 @@ static esp_err_t esp_console_common_init(esp_console_repl_com_t *repl_com) esp_console_config_t console_config = ESP_CONSOLE_CONFIG_DEFAULT(); #if CONFIG_LOG_COLORS console_config.hint_color = atoi(LOG_COLOR_CYAN); +#else + console_config.hint_color = -1; #endif ret = esp_console_init(&console_config); if (ret != ESP_OK) { diff --git a/components/console/linenoise/linenoise.c b/components/console/linenoise/linenoise.c index e09719dad2..8edebb60db 100644 --- a/components/console/linenoise/linenoise.c +++ b/components/console/linenoise/linenoise.c @@ -498,9 +498,10 @@ void refreshShowHints(struct abuf *ab, struct linenoiseState *l, int plen) { int hintmaxlen = l->cols-(plen+l->len); if (hintlen > hintmaxlen) hintlen = hintmaxlen; if (bold == 1 && color == -1) color = 37; - if (color != -1 || bold != 0) + if (color != -1 || bold != 0) { snprintf(seq,64,"\033[%d;%d;49m",bold,color); - abAppend(ab,seq,strlen(seq)); + abAppend(ab,seq,strlen(seq)); + } abAppend(ab,hint,hintlen); if (color != -1 || bold != 0) abAppend(ab,"\033[0m",4);