diff --git a/cmd/tools/vself.v b/cmd/tools/vself.v index 6818d82878..7f654fda98 100644 --- a/cmd/tools/vself.v +++ b/cmd/tools/vself.v @@ -7,6 +7,7 @@ fn main() { vexe := pref.vexe_path() vroot := os.dir(vexe) os.chdir(vroot) + os.setenv('VCOLORS', 'always', true) self_idx := os.args.index('self') args := os.args[1..self_idx] diff --git a/vlib/term/term.v b/vlib/term/term.v index f187e1a253..d8779d3a13 100644 --- a/vlib/term/term.v +++ b/vlib/term/term.v @@ -61,6 +61,10 @@ pub fn header(text, divider string) string { } fn supports_escape_sequences(fd int) bool { + vcolors_override := os.getenv('VCOLORS') + if vcolors_override == 'always' { + return true + } $if windows { return (is_atty(fd) & 0x0004) > 0 && os.getenv('TERM') != 'dumb' // ENABLE_VIRTUAL_TERMINAL_PROCESSING } $else {