Skip to content

Commit fdee8a2

Browse files
committed
fix for #3481, only applied in Windows
1 parent c24922f commit fdee8a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/cli/src/main/scala/scala/cli/ScalaCli.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,13 @@ object ScalaCli {
314314

315315
if (Properties.isWin && System.console() != null && coursier.paths.Util.useJni())
316316
// Enable ANSI output in Windows terminal
317-
coursier.jniutils.WindowsAnsiTerminal.enableAnsiOutput()
317+
try
318+
coursier.jniutils.WindowsAnsiTerminal.enableAnsiOutput()
319+
catch {
320+
// ignore error resulting from redirect STDOUT to /dev/null
321+
case e: java.io.IOException
322+
if Properties.isWin && e.getMessage.contains("GetConsoleMode error 6") =>
323+
}
318324

319325
new ScalaCliCommands(progName, baseRunnerName, fullRunnerName)
320326
.main(scalaCliArgs)

0 commit comments

Comments
 (0)