Skip to content

[Feature request] Auto-detect terminal width, support width > length #203

Description

@artagnon

Hi,

I'm trying to get the progress bar to fill the terminal width, and I'm using an 80-character terminal, but the following code doesn't seem to work:

    let progress = new ProgressBar(`[${'TeX'.green}]:  |:bar| :current/:total`, {
        width: 80 - 15,
        total: argv._.length,
        incomplete: ' ',
    });

It's like width doesn't do anything at all, I conjecture, because I have only 51 (< 75) items. It would be nice if progress could auto-detect the terminal width, and fill it appropriately.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions