Skip to content

Commit

Permalink
Send AttrOff when clearing the screen (#523)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wedaly authored Apr 16, 2022
1 parent 78490bd commit 1510fff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tscreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ func (t *tScreen) Show() {
}

func (t *tScreen) clearScreen() {
t.TPuts(t.ti.AttrOff)
fg, bg, _ := t.style.Decompose()
t.sendFgBg(fg, bg)
t.TPuts(t.ti.Clear)
Expand Down

0 comments on commit 1510fff

Please sign in to comment.