Skip to content

Multiple progress bars end up on a single line under osx with 0.9.4 #145

@spinscale

Description

@spinscale

I am creating multiple progress bars, each one as a task in a thread pool (up to 300). When. the thread pool is running more than one task at once, the progress bars all end up on the same line.

I checked an Terminal.cursorMovementSupported is set to true.

The code looks like this:

executorService.submit(() -> {
    try (CliProgressMonitor progressMonitor = new CliProgressMonitor(message, terminalWidth.get())) {
        // do long running task
    }
});


private static final class CliProgressMonitor extends BatchingProgressMonitor implements AutoCloseable {

    private final ProgressBar progressBar;

    public CliProgressMonitor(String message, int terminalWidth) {
        this.progressBar = new ProgressBarBuilder()
            .setStyle(ProgressBarStyle.UNICODE_BLOCK)
            .setTaskName(message)
            .setMaxRenderedLength(terminalWidth)
            .hideETA()
            .build();
    }

    ...
}

Is there anything wrong with the approach, should the closing of the progressbar be changed or sth?

Thanks for your help!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions