in src/com/pty4j/windows/winpty/WinPtyProcess.java [68:98]
private WinPtyProcess(@NotNull Command command,
@NotNull String environment,
@Nullable String workingDirectory,
@Nullable Integer initialColumns,
@Nullable Integer initialRows,
boolean consoleMode,
boolean enableAnsiColor) throws IOException {
myConsoleMode = consoleMode;
myCommand = command;
String commandLine = command.toCommandLine();
try {
myWinPty = new WinPty(commandLine, workingDirectory, environment, consoleMode,
initialColumns, initialRows, enableAnsiColor);
} catch (WinPtyException e) {
throw new IOException("Couldn't create PTY", e);
}
myInputStream = new WinPTYInputStream(myWinPty, myWinPty.getInputPipe());
myOutputStream = new WinPTYOutputStream(myWinPty, myWinPty.getOutputPipe(), consoleMode, true);
if (!consoleMode) {
myErrorStream = new InputStream() {
@Override
public int read() {
return -1;
}
};
} else {
myErrorStream = new WinPTYInputStream(myWinPty, myWinPty.getErrorPipe());
}
}