console-rs / console-rs/console
How to deal with overflowing lines?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 144
- Avg merge
- 8h 24m
- Merged PRs (30d)
- 4
Description
I am having trouble with clearing when lines overflow. If all the lines of the output are within the terminal width, the terminal is cleared properly via the following.
self.term.clear_to_end_of_screen()?;
self.term.clear_last_lines(self.height)?; // height being the number of lines of the written output
But when one of the lines (see screenshow) overflows, the first line of the output is not cleared and written all over again. Even if i account for overflowing lines and increase the height to clear, the first line is not cleared.
Any ideas how to mitigate this?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the example source in src/multiselect.rs and inspect how console's clear_to_end_of_screen() and clear_last_lines() handle output containing an overflowing line. Reproduce the reported behavior with a terminal-width overflow and compare it with output whose lines fit. Done means the complete prior output, including its first line, is cleared before redraw.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100