8151570: jtreg tests leave tty in bad state
Summary: Use unsupported terminal when running tests, to avoid setting tty to a raw mode.
Reviewed-by: rfield
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java Wed Feb 24 15:31:36 2016 -0800
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java Fri Mar 11 13:00:33 2016 +0100
@@ -48,6 +48,7 @@
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 @@
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);