Added terminal detection
This commit is contained in:
parent
929938dcd6
commit
71c74c800b
12 changed files with 37 additions and 79 deletions
|
@ -2,7 +2,9 @@ package color
|
|||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.akyoto.dev/go/color/tty"
|
||||
)
|
||||
|
||||
// Terminal is a boolean that indicates if we're in a terminal with truecolor support.
|
||||
var Terminal = os.Getenv("COLORTERM") == "truecolor"
|
||||
var Terminal = tty.IsTerminal(os.Stdout.Fd()) && os.Getenv("COLORTERM") == "truecolor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue