Skip to content

Commit 8370e29

Browse files
committed
Use a different enum when using the ENABLE_VIRTUAL_TERMINAL_PROCESSING on windows
1 parent 7be32c5 commit 8370e29

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private static PrintStream ansiSystem(boolean stdout) {
135135
int[] mode = new int[1];
136136
if (GetConsoleMode(console, mode) != 0
137137
&& SetConsoleMode(console, mode[0] | ENABLE_VIRTUAL_TERMINAL_PROCESSING) != 0) {
138-
jansiOutputType = JansiOutputType.PASSTHROUGH;
138+
jansiOutputType = JansiOutputType.VIRTUAL_TERMINAL;
139139
return newPrintStream(out, enc);
140140
}
141141
}
@@ -517,7 +517,8 @@ enum JansiOutputType {
517517
RESET_ANSI_AT_CLOSE("like pass through but reset ANSI attributes when closing the stream"),
518518
STRIP_ANSI("strip ANSI escape codes, for example when output is not a terminal"),
519519
WINDOWS("detect ANSI escape codes and transform Jansi-supported ones into a Windows API to get desired effect" +
520-
" (since ANSI escape codes are not natively supported by Windows terminals like cmd.exe or PowerShell)");
520+
" (since ANSI escape codes are not natively supported by Windows terminals like cmd.exe or PowerShell)"),
521+
VIRTUAL_TERMINAL("recent Windows support ANSI processing using a windows API call to configure the console in the correct mode");
521522

522523
private final String description;
523524

0 commit comments

Comments
 (0)