Skip to content

Commit

Permalink
Accept more forced color values
Browse files Browse the repository at this point in the history
Extend the color variables to leniently accept more color values. So
besides only `FORCE_COLOR=256color`, also accept e.g.
`FORCE_COLOR=256colors` to force 256 colors. Similarly, besides
`FORCE_COLOR=truecolor`, accept e.g. `FORCE_COLOR=24bits` to force
true colors.
  • Loading branch information
sschuberth committed Mar 9, 2024
1 parent 162d64f commit 2bce7d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ internal object TerminalDetection {
else -> when (getEnv("FORCE_COLOR")?.lowercase()) {
"0", "false", "none" -> NONE
"1", "", "true", "16color" -> ANSI16
"2", "256color" -> ANSI256
"3", "truecolor" -> TRUECOLOR
"2", in TERM_256COLOR_VALUES -> ANSI256
"3", in COLORTERM_TRUECOLOR_VALUES -> TRUECOLOR
else -> null
}
}
Expand Down

0 comments on commit 2bce7d9

Please sign in to comment.