Skip to content

Commit

Permalink
Use reflection for the Console class
Browse files Browse the repository at this point in the history
  • Loading branch information
cushon authored and remkop committed Aug 14, 2023
1 parent 2631db1 commit 60c446d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -17846,7 +17846,7 @@ static boolean calcTTY() {
return false;
}
try {
Method isTerminal = Console.class.getDeclaredMethod("isTerminal");
Method isTerminal = Class.forName("java.io.Console").getDeclaredMethod("isTerminal");
return (boolean) isTerminal.invoke(console);
} catch (NoSuchMethodException e) {
return true;
Expand Down

0 comments on commit 60c446d

Please sign in to comment.