
Detects terminal color capabilities from environment and TERM, recognizes truecolor and CI, respects NO_COLOR/CLICOLOR flags, and optionally enables Windows ANSI/virtual-terminal processing.
This is a Kotlin Multiplatform line-by-line port of rust-cli/anstyle (anstyle-query).
dependencies {
implementation("io.github.kotlinmania:anstyle-query-kotlin:0.1.0")
}Package io.github.kotlinmania.anstylequery:
clicolor(): Boolean? — checks CLICOLOR
clicolorForce(): Boolean — checks CLICOLOR_FORCE
noColor(): Boolean — checks NO_COLOR
termSupportsColor(): Boolean — checks TERM for color supporttermSupportsAnsiColor(): Boolean — checks TERM for ANSI color supporttruecolor(): Boolean — checks COLORTERM ("truecolor" or "24bit")isCi(): Boolean — checks CI presencePackage io.github.kotlinmania.anstylequery.windows:
enableAnsiColors(): Boolean? — enables ENABLE_VIRTUAL_TERMINAL_PROCESSING on Windows (null on non-Windows)enableVirtualTerminalProcessing(): Boolean — raw Windows console VT enablement (mingwMain)./gradlew build
./gradlew testThis is a Kotlin Multiplatform line-by-line port of rust-cli/anstyle (anstyle-query).
dependencies {
implementation("io.github.kotlinmania:anstyle-query-kotlin:0.1.0")
}Package io.github.kotlinmania.anstylequery:
clicolor(): Boolean? — checks CLICOLOR
clicolorForce(): Boolean — checks CLICOLOR_FORCE
noColor(): Boolean — checks NO_COLOR
termSupportsColor(): Boolean — checks TERM for color supporttermSupportsAnsiColor(): Boolean — checks TERM for ANSI color supporttruecolor(): Boolean — checks COLORTERM ("truecolor" or "24bit")isCi(): Boolean — checks CI presencePackage io.github.kotlinmania.anstylequery.windows:
enableAnsiColors(): Boolean? — enables ENABLE_VIRTUAL_TERMINAL_PROCESSING on Windows (null on non-Windows)enableVirtualTerminalProcessing(): Boolean — raw Windows console VT enablement (mingwMain)./gradlew build
./gradlew test