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 clearing the current console line #8

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Dec 19, 2020

Clear the previously written line instead of clearing the whole console window width. This way, when resizing the console window, lines don't wrap.

Here's a GIF to better understand what happens. The first two message batches use the console width (code before this commit). The last two message batches use the new code that clear only what's needed. Dots have been added (second and fourth samples) instead of spaces to better see why line wraps.

clear-console-line

Clear the previously written line instead of clearing the whole console window width. This way, when resizing the console window, lines don't wrap.
@mayuki
Copy link
Owner

mayuki commented Dec 22, 2020

Thank you for your contribution! This fix looks really good to me.

@mayuki mayuki merged commit 4a6c944 into mayuki:master Dec 22, 2020
@0xced 0xced deleted the clear-console-line branch December 23, 2020 08:37
@0xced
Copy link
Contributor Author

0xced commented Dec 23, 2020

Thanks for merging and releasing a new version so quickly ! 🎉

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