From eee69db96dd84eda04f703719f25db4ccf36aa25 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Fri, 11 Mar 2016 13:00:33 +0100 Subject: [PATCH] 8151570: jtreg tests leave tty in bad state Use unsupported terminal when running tests, to avoid setting tty to a raw mode. Reviewed-by: rfield --- .../classes/jdk/internal/jshell/tool/ConsoleIOContext.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java index 53df5fe0221..d86319f7254 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java @@ -48,6 +48,7 @@ import java.util.function.Supplier; import jdk.internal.jline.NoInterruptUnixTerminal; import jdk.internal.jline.Terminal; import jdk.internal.jline.TerminalFactory; +import jdk.internal.jline.UnsupportedTerminal; import jdk.internal.jline.WindowsTerminal; import jdk.internal.jline.console.ConsoleReader; import jdk.internal.jline.console.KeyMap; @@ -68,7 +69,9 @@ class ConsoleIOContext extends IOContext { this.repl = repl; this.input = new StopDetectingInputStream(() -> repl.state.stop(), ex -> repl.hard("Error on input: %s", ex)); Terminal term; - if (System.getProperty("os.name").toLowerCase(Locale.US).contains(TerminalFactory.WINDOWS)) { + if (System.getProperty("test.jdk") != null) { + term = new UnsupportedTerminal(); + } else if (System.getProperty("os.name").toLowerCase(Locale.US).contains(TerminalFactory.WINDOWS)) { term = new JShellWindowsTerminal(input); } else { term = new JShellUnixTerminal(input);