Skip to content

Commit

Permalink
Only increment counter if install successful (#243)
Browse files Browse the repository at this point in the history
This closes #242
  • Loading branch information
kwin committed Jun 22, 2023
1 parent 80a3799 commit 5f5f95c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/fusesource/jansi/AnsiConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ public static PrintStream sysErr() {
* @see #systemUninstall()
*/
synchronized static public void systemInstall() {
installed++;
if (installed == 1) {
if (installed == 0) {
initStreams();
try {
((AnsiPrintStream) out).install();
Expand All @@ -520,6 +519,7 @@ synchronized static public void systemInstall() {
System.setOut(out);
System.setErr(err);
}
installed++;
}

/**
Expand Down

0 comments on commit 5f5f95c

Please sign in to comment.