Skip to content

Commit

Permalink
Fix to pass jballerina-integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
RadCod3 committed Mar 5, 2024
1 parent 9cc9ef1 commit 8c1e4d1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
import io.ballerina.tools.diagnostics.Location;
import io.ballerina.tools.text.TextDocument;
import org.jline.jansi.Ansi;
import org.jline.jansi.AnsiConsole;
import org.jline.terminal.TerminalBuilder;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -67,7 +68,11 @@ public static Ansi renderDiagnostic(Diagnostic diagnostic, Document document, in
}

public static int getTerminalWidth() {
return AnsiConsole.getTerminalWidth();
try {
return TerminalBuilder.builder().dumb(true).build().getWidth();
} catch (IOException e) {
return 999;
}
}

public static Ansi renderDiagnostic(Diagnostic diagnostic, boolean colorEnabled) {
Expand Down

0 comments on commit 8c1e4d1

Please sign in to comment.