Skip to content

Commit

Permalink
fix: only reset terminal colors if they're changed
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 13, 2024
1 parent 1bd66e6 commit 45222df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ func (p *Program) restoreTerminalState() error {
}

// Restore terminal colors.
if p.bg != nil {
if p.setBg != nil && p.bg != nil {
p.execute(ansi.SetBackgroundColor(p.bg))
}
if p.fg != nil {
if p.setFg != nil && p.fg != nil {
p.execute(ansi.SetForegroundColor(p.fg))
}
if p.cc != nil {
if p.setCc != nil && p.cc != nil {
p.execute(ansi.SetCursorColor(p.cc))
}

Expand Down

0 comments on commit 45222df

Please sign in to comment.