-
Notifications
You must be signed in to change notification settings - Fork 194
Basic clear #30
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
Basic clear #30
Conversation
Addresses nushell#28 Succeeds in providing a clear new screen for both the line editing and reverse search mode. Solution is conservative and prints more newlines than strictly necessary as solutions with scrolling didn't seem to work as expected.
| stdout.queue(Print("\n"))?; | ||
| } | ||
| stdout.queue(MoveTo(0, 0))?; | ||
| stdout.flush()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be able to run this crossterm command for a clear in one step: https://docs.rs/crossterm/0.19.0/crossterm/terminal/enum.ClearType.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClearType::All only blanks the currently visible screen, so you cannot scroll back up to the previous output as with bash et al.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I learned :)
|
@sholderbach - sounds good. Once we fix the conflict fixed we can land. |
|
Merging with the fancy prompt currently has some weird interaction with my requirement to repaint the line_buffer content at the beginning of |
The prompt indicator gets drawn over when searching the history so we need to restore it when done searching.
Resolves the issues of redrawing the prompt in combination with screen clearing commands 'clear' and Ctrl+L
|
Combined with the fix from @jasonrhansen pulled from #31 and a slight reordering of my redraw, the prompt remains correct in all known single-line circumstances. |
|
Sounds good. Let's land, then see if we can refactor the prompt parts |

Addresses #28
Succeeds in providing a clear new screen for both the line editing and
reverse search mode.
Solution is conservative and prints more newlines than strictly
necessary as solutions with scrolling didn't seem to work as expected and exactly computing the length of the current written space is not trivial as multiline support is not fully settled yet.