Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recurive Loop #38

Closed
leifdejong opened this issue Mar 15, 2017 · 3 comments
Closed

Recurive Loop #38

leifdejong opened this issue Mar 15, 2017 · 3 comments

Comments

@leifdejong
Copy link

leifdejong commented Mar 15, 2017

Hi, I interestingly managed to create some sort of infinite loop in ora: 1.1.0:

const ora = require('ora');
const spinner = ora("bash:git fetch --all && git reset --hard origin/develop && git pull origin develop").start();

If you omit the "develop" at the end of the string, the problem stops

bug

@SamVerschueren
Copy link
Contributor

It's because the output exceeds the length of the terminal.

@UnleashedMind
Copy link

I got this as a surprise during an important demo.
I don't understand the reason on this behavior, why do we need to keep printing if it message exceeds the terminal width?

@novemberborn
Copy link
Contributor

Ora currently clears the last line. It doesn't realize that every time it writes, it writes multiple lines. Thus it never clears all required lines.

sindresorhus pushed a commit that referenced this issue Feb 21, 2018
* Conform with latest XO

* Handle wrapped text

Count how many rows are taken up by the spinner and the text and clear
the appropriate number of lines. Fix clear() so it doesn't clear
*further* lines until render() is called again.

Fixes #38. Fixes #7.

* Add hideCursor option

Fixes #27. Users may still hide the cursor outside of Ora.

* Test with Node.js 8 and 9

* Properly clear empty lines

* Consistently set linesToClear to 0 once cleared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants