From 869820ec6de3bc26d98e5e7420500d0fbde9408d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 30 Jul 2026 05:16:39 +0900 Subject: cmd/mbf: enable output colouring This respects the de facto standards, on top of checking stderr. Signed-off-by: Ophestra --- cmd/mbf/main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/mbf/main.go') diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index d464fd54..db6c1a0a 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -92,6 +92,11 @@ func main() { var cm cache defer func() { cm.Close() }() + if cm.color = ext.Isatty(syscall.Stderr) && + os.Getenv("NO_COLOR") == "" && + os.Getenv("TERM") != "dumb"; cm.color { + log.SetPrefix("\x1b[2mmbf: \x1b[0m") + } var ( flagQuiet bool -- cgit v1.3.1