8135151: jjs should work in cygwin environment
Reviewed-by: attila, hannesw
This commit is contained in:
parent
bb5c8037e7
commit
43250a33e1
@ -49,9 +49,9 @@ class Console implements AutoCloseable {
|
||||
|
||||
Console(final InputStream cmdin, final PrintStream cmdout, final File historyFile,
|
||||
final Completer completer) throws IOException {
|
||||
TerminalFactory.registerFlavor(Flavor.WINDOWS, isCygwin()? JJSUnixTerminal::new : JJSWindowsTerminal::new);
|
||||
TerminalFactory.registerFlavor(Flavor.UNIX, JJSUnixTerminal::new);
|
||||
in = new ConsoleReader(cmdin, cmdout);
|
||||
TerminalFactory.registerFlavor(Flavor.WINDOWS, JJSWindowsTerminal :: new);
|
||||
TerminalFactory.registerFlavor(Flavor.UNIX, JJSUnixTerminal :: new);
|
||||
in.setExpandEvents(false);
|
||||
in.setHandleUserInterrupt(true);
|
||||
in.setBellEnabled(true);
|
||||
@ -134,4 +134,8 @@ class Console implements AutoCloseable {
|
||||
setAnsiSupported(false);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isCygwin() {
|
||||
return System.getenv("SHELL") != null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user