mirror of
https://github.com/walles/moar.git
synced 2024-08-17 07:50:35 +03:00
Use 24-bit color if COLORTERM=truecolor
is in the environment
This commit is contained in:
parent
1043d3feb7
commit
e5a600b51d
2
moar.go
2
moar.go
@ -304,7 +304,7 @@ func parseStyleOption(styleOption string) (*chroma.Style, error) {
|
||||
func parseColorsOption(colorsOption string) (twin.ColorType, error) {
|
||||
if strings.ToLower(colorsOption) == "auto" {
|
||||
colorsOption = "16M"
|
||||
if strings.Contains(os.Getenv("TERM"), "256") {
|
||||
if os.Getenv("COLORTERM") != "truecolor" && strings.Contains(os.Getenv("TERM"), "256") {
|
||||
// Covers "xterm-256color" as used by the macOS Terminal
|
||||
colorsOption = "256"
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ func NewScreen() (Screen, error) {
|
||||
|
||||
func NewScreenWithMouseMode(mouseMode MouseMode) (Screen, error) {
|
||||
terminalColorCount := ColorType24bit
|
||||
if strings.Contains(os.Getenv("TERM"), "256") {
|
||||
if os.Getenv("COLORTERM") != "truecolor" && strings.Contains(os.Getenv("TERM"), "256") {
|
||||
// Covers "xterm-256color" as used by the macOS Terminal
|
||||
terminalColorCount = ColorType256
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user