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

fix: remove extra blank line in terminal when output is empty #383

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

EvgenyWas
Copy link
Contributor

The simpler solution is to use process.stdout.moveCursor() and process.stdout.clearLine() directly. However, if TTY is not available we can not use those methods and consuming readline is a better-supported solution to do that.

Resolves #363

@ai ai merged commit 3542c73 into ai:main Jan 28, 2025
4 checks passed
@ai
Copy link
Owner

ai commented Jan 28, 2025

Am I right than in non-TTY env it will do nothing (double line, which is OK)?

@EvgenyWas
Copy link
Contributor Author

Am I right than in non-TTY env it will do nothing (double line, which is OK)?

No, it will work as expected. I mentioned TTY here just because process.stdout.moveCursor() was failing with the following error TypeError: process.stdout.moveCursor is not a function because the process is being run out of a TTY context during running tests. The usage of readline is more reliable here.

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

Successfully merging this pull request may close these issues.

Extra blank lines when using --silent
2 participants