Skip to content

Commit

Permalink
Use a different enum when using the ENABLE_VIRTUAL_TERMINAL_PROCESSIN…
Browse files Browse the repository at this point in the history
…G on windows
  • Loading branch information
gnodet committed Oct 23, 2020
1 parent 7be32c5 commit 8370e29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static PrintStream ansiSystem(boolean stdout) {
int[] mode = new int[1];
if (GetConsoleMode(console, mode) != 0
&& SetConsoleMode(console, mode[0] | ENABLE_VIRTUAL_TERMINAL_PROCESSING) != 0) {
jansiOutputType = JansiOutputType.PASSTHROUGH;
jansiOutputType = JansiOutputType.VIRTUAL_TERMINAL;
return newPrintStream(out, enc);
}
}
Expand Down Expand Up @@ -517,7 +517,8 @@ enum JansiOutputType {
RESET_ANSI_AT_CLOSE("like pass through but reset ANSI attributes when closing the stream"),
STRIP_ANSI("strip ANSI escape codes, for example when output is not a terminal"),
WINDOWS("detect ANSI escape codes and transform Jansi-supported ones into a Windows API to get desired effect" +
" (since ANSI escape codes are not natively supported by Windows terminals like cmd.exe or PowerShell)");
" (since ANSI escape codes are not natively supported by Windows terminals like cmd.exe or PowerShell)"),
VIRTUAL_TERMINAL("recent Windows support ANSI processing using a windows API call to configure the console in the correct mode");

private final String description;

Expand Down

0 comments on commit 8370e29

Please sign in to comment.