diff --git a/esphome/__main__.py b/esphome/__main__.py index a696cceffb0..25b404ae45c 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -1083,7 +1083,7 @@ def command_config(args: ArgsProtocol, config: ConfigType) -> int | None: # add the console decoration so the front-end can hide the secrets if not args.show_secrets: output = re.sub( - r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output + r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[8m\2\\033[28m", output ) if not CORE.quiet: safe_print(output) diff --git a/esphome/core/log.h b/esphome/core/log.h index ff39633142e..72e06cabacb 100644 --- a/esphome/core/log.h +++ b/esphome/core/log.h @@ -54,8 +54,8 @@ namespace esphome { #define ESPHOME_LOG_COLOR_CYAN "36" // DEBUG #define ESPHOME_LOG_COLOR_GRAY "37" // VERBOSE #define ESPHOME_LOG_COLOR_WHITE "38" -#define ESPHOME_LOG_SECRET_BEGIN "\033[5m" -#define ESPHOME_LOG_SECRET_END "\033[6m" +#define ESPHOME_LOG_SECRET_BEGIN "\033[8m" +#define ESPHOME_LOG_SECRET_END "\033[28m" #define LOG_SECRET(x) ESPHOME_LOG_SECRET_BEGIN x ESPHOME_LOG_SECRET_END #define ESPHOME_LOG_COLOR(COLOR) "\033[0;" COLOR "m"