File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/java/org/fusesource/jansi Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ public static int getTerminalWidth() {
213213
214214 static final int ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 ;
215215
216+ static int STDOUT_FILENO = 1 ;
217+
218+ static int STDERR_FILENO = 2 ;
219+
216220
217221 static {
218222 if (getBoolean (JANSI_EAGER )) {
@@ -236,7 +240,9 @@ private static AnsiPrintStream ansiStream(boolean stdout) {
236240 final boolean isatty ;
237241 boolean isAtty ;
238242 boolean withException ;
239- final int fd = stdout ? CLibrary .STDOUT_FILENO : CLibrary .STDERR_FILENO ;
243+ // Do not use the CLibrary.STDOUT_FILENO to avoid errors in case
244+ // the library can not be loaded on unsupported platforms
245+ final int fd = stdout ? STDOUT_FILENO : STDERR_FILENO ;
240246 try {
241247 // If we can detect that stdout is not a tty.. then setup
242248 // to strip the ANSI sequences..
You can’t perform that action at this time.
0 commit comments