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

Send AttrOff when clearing the screen #523

Merged
merged 1 commit into from Apr 16, 2022

Conversation

wedaly
Copy link
Contributor

@wedaly wedaly commented Apr 8, 2022

In tcell v2.4, the following calls would reset the screen
to its default color:

  1. SetContent() to change the bg color to maroon.
  2. Clear()
  3. Show()

In tcell v2.5, the behavior changed to clear the screen
to the last-used style passed to SetContent.

This happens because commit 62f5502 set the dirty flag
to false for all cells, on the assumption that sending
ti.Clear would clear the cells anyway. Unlike the drawCell
calls triggered by the dirty flag, however, clearScreen
does not send AttrOff. This causes the screen to clear
to the last-used background color.

Issue: #522

In tcell v2.4, the following calls would reset the screen
to its default color:

1. SetContent() to change the bg color to maroon.
2. Clear()
3. Show()

In tcell v2.5, the behavior changed to clear the screen
to the last-used style passed to SetContent.

This happens because commit 62f5502 set the dirty flag
to false for all cells, on the assumption that sending
ti.Clear would clear the cells anyway. Unlike the drawCell
calls triggered by the dirty flag, however, clearScreen
does not send AttrOff. This causes the screen to clear
to the last-used background color.
@gdamore
Copy link
Owner

gdamore commented Apr 16, 2022

Thanks for resolving this.

@gdamore gdamore merged commit 1510fff into gdamore:master Apr 16, 2022
@wedaly wedaly deleted the clear-screen-attr-off branch April 16, 2022 16:14
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.

None yet

2 participants