From f406999cba69a77617ca7bcb5362a8238d258805 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 6 Oct 2022 12:38:15 +0200 Subject: [PATCH] fix: don't try to set alt screen when already in desired mode --- standard_renderer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/standard_renderer.go b/standard_renderer.go index 14edb3c..195ef59 100644 --- a/standard_renderer.go +++ b/standard_renderer.go @@ -260,6 +260,10 @@ func (r *standardRenderer) altScreen() bool { } func (r *standardRenderer) enterAltScreen() { + if r.altScreenActive { + return + } + r.mtx.Lock() defer r.mtx.Unlock() @@ -279,6 +283,10 @@ func (r *standardRenderer) enterAltScreen() { } func (r *standardRenderer) exitAltScreen() { + if !r.altScreenActive { + return + } + r.mtx.Lock() defer r.mtx.Unlock()