Skip to content

Commit

Permalink
Use stty as fallback provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Oct 9, 2023
1 parent b7c0487 commit a395a6c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.fusesource.jansi.internal;

import org.fusesource.jansi.internal.stty.Stty;

import static org.fusesource.jansi.AnsiConsole.JANSI_PROVIDERS;

public final class AnsiConsoleSupportHolder {
Expand All @@ -34,7 +36,14 @@ private static AnsiConsoleSupport getDefaultProvider() {
}
}

return new org.fusesource.jansi.internal.jni.AnsiConsoleSupportImpl();
try {
return new org.fusesource.jansi.internal.jni.AnsiConsoleSupportImpl();
} catch (Throwable e) {
if (!OSInfo.isWindows() && !OSInfo.isMacOS() && Stty.isFoundStty()) {
return new org.fusesource.jansi.internal.stty.AnsiConsoleSupportImpl();
}
throw e;
}
}

private static AnsiConsoleSupport findProvider(String providerList) {
Expand Down

0 comments on commit a395a6c

Please sign in to comment.