ajalt / mordant

Multiplatform text styling for Kotlin command-line applications

Home Page:https://ajalt.github.io/mordant/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add file / pipe utility functions to `Win32MppImpls`

sschuberth opened this issue · comments

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 #127 (comment)

This is a prerequisite to solve #38.