Skip to content

Commit 5f5f95c

Browse files
authoredJun 22, 2023
Only increment counter if install successful (#243)
This closes #242
1 parent 80a3799 commit 5f5f95c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,7 @@ public static PrintStream sysErr() {
508508
* @see #systemUninstall()
509509
*/
510510
synchronized static public void systemInstall() {
511-
installed++;
512-
if (installed == 1) {
511+
if (installed == 0) {
513512
initStreams();
514513
try {
515514
((AnsiPrintStream) out).install();
@@ -520,6 +519,7 @@ synchronized static public void systemInstall() {
520519
System.setOut(out);
521520
System.setErr(err);
522521
}
522+
installed++;
523523
}
524524

525525
/**

0 commit comments

Comments
 (0)
Please sign in to comment.