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

Clear terminal output of interactive screen on resize if alternate screen not in use #952

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dangooddd
Copy link

@dangooddd dangooddd commented Nov 12, 2024

This PR is submitted to close #951.

Few moments about changes:

  1. Interactive screen is always created with dimx = 0 and dimy = 0, so on first iteration of loop screen will be resized. In this situation we should not clear output of the screen.
    I add new variable validated_ that is true since second iteration.
    I think we can avoid this by passing component_ to the PreMain function to set init dimx and dimy, but than we should add component to the Install function, and than to the PostMain function... (will wait to implement this)
  2. Some part of scrollback (no more than one terminal screen) will be cleared because of how I chose to implement this, but i do not think it is big problem

@dangooddd
Copy link
Author

I think it works the way fzf does this. Results:

clear_on_resize.webm

@dangooddd dangooddd changed the title Clear terminal output of interactive screen if alternate screen not in use Clear terminal output of interactive screen on resize if alternate screen not in use Nov 12, 2024
Copy link
Owner

@ArthurSonzogni ArthurSonzogni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks!

I approved % minor comments below:

include/ftxui/component/screen_interactive.hpp Outdated Show resolved Hide resolved
src/ftxui/component/screen_interactive.cpp Outdated Show resolved Hide resolved
src/ftxui/component/screen_interactive.cpp Outdated Show resolved Hide resolved
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.

Resize ScreenInteractive::TerminalOutput() on SIGWINCH issue
2 participants