8000 erase the prev lines length · Issue #88 · unjs/webpackbar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
erase the prev lines length #88
Open
@LIUeng

Description

@LIUeng

problem description

  1. when the process.stderr.columns less than console.log('xxxxxx') string width, extra lines log, wrap line normal;
  2. the prevLineCount variable length calculate error;
  3. cause the terminal stdout occurs many whitespace lines;

source code

// LogUpdate -> render
const data = ansiEscapes.eraseLines(this.prevLineCount) + wrappedLines + '\n' + this.extraLines;
this.write(data);
// it's my problem === length is not true
this.prevLineCount = data.split('\n').length;

could you calculate length below?

this.prevLineCount = data.split('\n').length;
this.extraLines.split('\n').forEach(str => {
  if (str.length > this.columns) {
    this.prevLineCount += 1
  }
});

That's all, thank you!

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

      0