Adtivated TERM=mintty for mintty as Gradle now supports it natively (as of v5.2).
gradle.taskGraph.whenReady { graph ->
// graph.getAllTasks().findAll().each { println it }
def console = System.console() != null
def term = System.getenv()["TERM"];
if (! console && term != null) { console = term.startsWith("xterm") }
if (! console) return
graph.getAllTasks().findAll({it.name.equals("bootRun")}).each {
it.systemProperties 'spring.output.ansi.enabled': 'always'
// it.metaClass.methods*.name.sort().unique().each { println it }
};
// graph.metaClass.properties.each { println it }
// graph.metaClass.methods*.name.sort().unique().each { println it }
}