Skip to content

Commit

Permalink
Fix color and progress detection in driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 28, 2023
1 parent f7cb7b2 commit b373070
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2100,21 +2100,18 @@ protected String getXmxValue(int maxInstances) {
return Long.toUnsignedString(memMax);
}

private static final boolean IS_CI = SubstrateUtil.isRunningInCI();
private static final boolean IS_DUMB_TERM = isDumbTerm();

private static boolean isDumbTerm() {
String term = System.getenv().getOrDefault("TERM", "");
return term.isEmpty() || term.equals("dumb") || term.equals("unknown");
}

private static boolean hasColorSupport() {
return !IS_DUMB_TERM && !IS_CI && OS.getCurrent() != OS.WINDOWS &&
return !isDumbTerm() && !SubstrateUtil.isRunningInCI() && OS.getCurrent() != OS.WINDOWS &&
System.getenv("NO_COLOR") == null /* https://no-color.org/ */;
}

private static boolean hasProgressSupport(List<String> imageBuilderArgs) {
return !IS_DUMB_TERM && !IS_CI &&
return !isDumbTerm() && !SubstrateUtil.isRunningInCI() &&
/*
* When DebugOptions.Log is used, progress cannot be reported as logging
* works around NativeImageSystemIOWrappers to access stdio handles.
Expand Down

0 comments on commit b373070

Please sign in to comment.