Skip to content
Snippets Groups Projects
Commit 1163aa05 authored by Timur Safin's avatar Timur Safin Committed by Igor Munkin
Browse files

debugger: use NO_COLOR to disable coloring

Do not use non-standard DBG_NOCOLOR, but use NO_COLOR [^1]
for disabling color output on terminals.

[^1]: https://no-color.org/

NO_DOC=later
NO_CHANGELOG=internal
NO_TEST=internal
parent f7a5336c
No related branches found
No related tags found
No related merge requests found
...@@ -110,7 +110,7 @@ There are also some goodies you can use to make debugging easier. ...@@ -110,7 +110,7 @@ There are also some goodies you can use to make debugging easier.
Environment Variables: Environment Variables:
- -
Want to disable ANSI color support or disable GNU readline? Set the `DBG_NOCOLOR` and/or `DBG_NOREADLINE` environment variables. Want to disable ANSI color support or disable GNU readline? Set the `NO_COLOR`.
Known Issues: Known Issues:
- -
......
...@@ -750,7 +750,7 @@ local stdout_isatty = ffi.C.isatty(1) ...@@ -750,7 +750,7 @@ local stdout_isatty = ffi.C.isatty(1)
-- Conditionally enable color support. -- Conditionally enable color support.
local color_maybe_supported = (stdout_isatty and os.getenv("TERM") and os.getenv("TERM") ~= "dumb") local color_maybe_supported = (stdout_isatty and os.getenv("TERM") and os.getenv("TERM") ~= "dumb")
if color_maybe_supported and not os.getenv("DBG_NOCOLOR") then if color_maybe_supported and not os.getenv("NO_COLOR") then
COLOR_GRAY = string.char(27) .. "[90m" COLOR_GRAY = string.char(27) .. "[90m"
COLOR_RED = string.char(27) .. "[91m" COLOR_RED = string.char(27) .. "[91m"
COLOR_BLUE = string.char(27) .. "[94m" COLOR_BLUE = string.char(27) .. "[94m"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment