Skip to content

Commit

Permalink
Redirecting input from file to app fails when using CONEMU with Jansi,
Browse files Browse the repository at this point in the history
…fixes #298
  • Loading branch information
mattirn committed Dec 15, 2020
1 parent f0a4adf commit b53835a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public class JansiWinSysTerminal extends AbstractWindowsTerminal {

public static JansiWinSysTerminal createTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, SignalHandler signalHandler, boolean paused) throws IOException {
Writer writer;
int[] mode = new int[1];
if (ansiPassThrough) {
if (type == null) {
type = OSUtils.IS_CONEMU ? TYPE_WINDOWS_CONEMU : TYPE_WINDOWS;
}
writer = new JansiWinConsoleWriter();
} else {
int[] mode = new int[1];
if (Kernel32.GetConsoleMode(consoleOut, mode) == 0 ) {
throw new IOException("Failed to get console mode: " + getLastErrorMessage());
}
Expand All @@ -69,9 +69,9 @@ public static JansiWinSysTerminal createTerminal(String name, String type, boole
}
writer = new WindowsAnsiWriter(new BufferedWriter(new JansiWinConsoleWriter()));
}
if (Kernel32.GetConsoleMode(consoleIn, mode) == 0) {
throw new IOException("Failed to get console mode: " + getLastErrorMessage());
}
}
if (Kernel32.GetConsoleMode(consoleIn, mode) == 0) {
throw new IOException("Failed to get console mode: " + getLastErrorMessage());
}
JansiWinSysTerminal terminal = new JansiWinSysTerminal(writer, name, type, encoding, codepage, nativeSignals, signalHandler);
// Start input pump thread
Expand Down

0 comments on commit b53835a

Please sign in to comment.