ajalt / mordant

Multiplatform text styling for Kotlin command-line applications
https://ajalt.github.io/mordant/
Apache License 2.0
957 stars 34 forks source link

Add file / pipe utility functions to `Win32MppImpls` #129

Open sschuberth opened 11 months ago

sschuberth commented 11 months ago

when (getTermProgram()) { isn't reached even if output is not redirected to a file.

That's correct. Whenever we're in a situation where it's not possible to detect whether output is interactive or not (which is the case for Git for Windows), we should assume it is not, in order to avoid printing ANSI codes to a file.

Git for Windows itself has this detection mechanism

Yeah, that was the workaround I mentioned that we could add to Win32MppImpls in a separate PR.

_Originally posted by @ajalt in https://github.com/ajalt/mordant/pull/127#discussion_r1330356995_

sschuberth commented 11 months ago

This is a prerequisite to solve https://github.com/ajalt/mordant/issues/38.