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

Move cursor to the beginning of the line before erasing #126

Merged
merged 1 commit into from Dec 17, 2021

Conversation

HarryMichal
Copy link
Contributor

@HarryMichal HarryMichal commented Dec 17, 2021

The \033[K escape sequence signifies 'clear from cursor position to the
end of the line'. Without moving the cursor to the beggining of the line
first it results in no text being deleted. The behaviour of Carriage
Return (\r) in terminal emulators is not formally standardized but it is
generally interpreted as a move to the beginning of the line.

Tested on both Linux and Windows (cmd.exe, WSL2 and Windows Terminal).

Fixes #123

The \033[K escape sequence signifies 'clear from cursor position to the
end of the line'. Without moving the cursor to the beggining of the line
first it results in no text being deleted. The behaviour of Carriage
Return (\r) in terminal emulators is not formally standardized but it is
generally interpreted as a move to the beginning of the line.

Fixes briandowns#123
@briandowns
Copy link
Owner

Thanks for the contribution!

@briandowns briandowns merged commit 12b31a6 into briandowns:master Dec 17, 2021
@HarryMichal HarryMichal deleted the properly-erase-lines branch December 17, 2021 13:10
strider added a commit to strider/rhc that referenced this pull request Jan 21, 2022
In commit [1], we've had to downgrade that package due to a rendering
bug[2]. This latter has been fixed upstream[3] and released in the v1.17.0[4].
We can now 'revert' the downgrade to v1.13.0 by upgrading directly to
the v1.17.0.

[1] 2fc8d7d
[2] briandowns/spinner#123
[3] briandowns/spinner#126
[4] https://github.com/briandowns/spinner/releases/tag/v1.17.0

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
subpop pushed a commit to RedHatInsights/rhc that referenced this pull request Jan 21, 2022
In commit [1], we've had to downgrade that package due to a rendering
bug[2]. This latter has been fixed upstream[3] and released in the v1.17.0[4].
We can now 'revert' the downgrade to v1.13.0 by upgrading directly to
the v1.17.0.

[1] 2fc8d7d
[2] briandowns/spinner#123
[3] briandowns/spinner#126
[4] https://github.com/briandowns/spinner/releases/tag/v1.17.0

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
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.

Stop() doesn't clean up the current line
2 participants