File tree 1 file changed +23
-2
lines changed
jansi/src/main/java/org/fusesource/jansi
1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 35
35
public class AnsiConsole {
36
36
37
37
public static final PrintStream system_out = System .out ;
38
- public static final PrintStream out = new PrintStream ( wrapOutputStream ( system_out )) ;
38
+ public static final PrintStream out ;
39
39
40
40
public static final PrintStream system_err = System .err ;
41
- public static final PrintStream err = new PrintStream ( wrapOutputStream ( system_err , STDERR_FILENO )) ;
41
+ public static final PrintStream err ;
42
42
43
43
private static int installed ;
44
44
45
+ static
46
+ {
47
+ PrintStream jansiOut ;
48
+ PrintStream jansiErr ;
49
+
50
+ try
51
+ {
52
+ jansiOut = new PrintStream ( wrapOutputStream ( system_out ) );
53
+ jansiErr = new PrintStream ( wrapOutputStream ( system_err , STDERR_FILENO ) );
54
+ }
55
+ catch ( final UnsatisfiedLinkError e )
56
+ {
57
+ // Failure loading native library.
58
+ jansiOut = system_out ;
59
+ jansiErr = system_err ;
60
+ }
61
+
62
+ out = jansiOut ;
63
+ err = jansiErr ;
64
+ }
65
+
45
66
private AnsiConsole () {
46
67
}
47
68
You can’t perform that action at this time.
0 commit comments