Skip to content

ProgressView don't finish correctly #1153

Open
@piotrooo

Description

@piotrooo

When I try to run ProgressView, it seems to finish incorrectly. For example, in the sample code:

@Bean
public ApplicationListener<ApplicationStartedEvent> applicationStartedListener(ViewComponentBuilder viewComponentBuilder) {
    return event -> {
        ProgressView.ProgressViewItem text = ofText(15, LEFT);
        ProgressView.ProgressViewItem spinner = ofSpinner(10, LEFT);
        ProgressView view = new ProgressView(text, spinner);
        view.setDescription("Waiting...");
        view.setSpinner(Spinner.of(DOTS1, 80));
        view.setRect(0, 0, 20, 1);

        ViewComponent component = viewComponentBuilder.build(view);
        view.start();
        ViewComponent.ViewComponentRun run = component.runAsync();
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        view.stop();
        run.cancel();
    };
}

After the progress completes, I always need to press Enter to trigger auto-competition again.

asciicast

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/need-triageTeam needs to triage and take a first look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions