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

Improve line break handling when using ANSI escapes #4

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

dumbmatter
Copy link
Contributor

I understand not using strip-ansi and string-width like ora to keep the package size small, but stripVTControlCharacters has been in Node.js since version 16 and it seems to work just as well.

Possibly a similar PR would be good for ora to replace those dependencies, but I'm unsure if strip-ansi and string-width have some advantage over stripVTControlCharacters. Regardless, stripVTControlCharacters does seem like a clear win over nothing!

@sindresorhus sindresorhus merged commit 5962422 into sindresorhus:main Jan 20, 2025
3 checks passed
@sindresorhus sindresorhus changed the title Use stripVTControlCharacters to more accurately count line breaks Improve line break handling when using ANSI escapes Jan 20, 2025
@sindresorhus
Copy link
Owner

Possibly a similar PR would be good for ora to replace those dependencies, but I'm unsure if strip-ansi and string-width have some advantage over stripVTControlCharacters

The benefit of strip-ansi is documented here: https://github.com/chalk/strip-ansi?tab=readme-ov-file#strip-ansi I don't plan to remove those dependencies in Ora.

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.

2 participants