diff --git a/src/org/rascalmpl/debug/IRascalMonitor.java b/src/org/rascalmpl/debug/IRascalMonitor.java index 124ece36592..78e33a1426a 100644 --- a/src/org/rascalmpl/debug/IRascalMonitor.java +++ b/src/org/rascalmpl/debug/IRascalMonitor.java @@ -159,7 +159,7 @@ default void jobStep(String name, String message) { * @return */ public static IRascalMonitor buildConsoleMonitor(InputStream in, OutputStream out) { - return IsTTY.isTTY() + return System.console() != null ? new TerminalProgressBarMonitor(out, in, TerminalFactory.get()) : new ConsoleRascalMonitor(new PrintStream(out)) ; diff --git a/src/org/rascalmpl/repl/IsTTY.java b/src/org/rascalmpl/repl/IsTTY.java deleted file mode 100644 index 69ceb60b3b0..00000000000 --- a/src/org/rascalmpl/repl/IsTTY.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.rascalmpl.repl; - -import java.util.Locale; - -import org.fusesource.jansi.internal.CLibrary; -import org.fusesource.jansi.internal.Kernel32; - -public class IsTTY { - - /** - * Until we switch to jline 3 we will need this - * @return - */ - public static boolean isTTY() { - // TODO definitely does not work for CYGWIN - if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win")) { - long console = Kernel32.GetStdHandle(Kernel32.STD_OUTPUT_HANDLE); - return Kernel32.GetConsoleMode(console, new int[1]) != 0; - } - else { - int fd = CLibrary.STDOUT_FILENO; - return CLibrary.isatty(fd) != 0; - } - } -}