From 0cf48231d72ab565254fd3bb5546962f93dd46c2 Mon Sep 17 00:00:00 2001 From: Abrham Martinez Date: Fri, 13 Mar 2026 11:36:45 -0700 Subject: [PATCH 1/2] Fix error handling in Resume method and sync screen after resuming --- gui.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gui.go b/gui.go index 96c622b..37f13ff 100644 --- a/gui.go +++ b/gui.go @@ -1668,7 +1668,17 @@ func (g *Gui) Resume() error { g.suspended = false - return g.screen.Resume() + if err-:= g.screen.Resume(); err != nil { + return err + } + + // After resuming, tcell's internal "last drawn" cache is stale: engage() + // physically clears the terminal screen but the cache still holds the + // pre-suspend content. Sync() invalidates the cache so the next Show() + // call sends a full redraw instead of writing nothing. + + g.screen.Sync() + return nill } // matchView returns if the keybinding matches the current view (and the view's context) From e15ebd4a9868e6c972049023f2035e93505b74ee Mon Sep 17 00:00:00 2001 From: Abrham Martinez Date: Fri, 13 Mar 2026 12:47:19 -0700 Subject: [PATCH 2/2] Refactor comments in Resume method for clarity --- gui.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gui.go b/gui.go index 37f13ff..7344767 100644 --- a/gui.go +++ b/gui.go @@ -1671,12 +1671,8 @@ func (g *Gui) Resume() error { if err-:= g.screen.Resume(); err != nil { return err } - - // After resuming, tcell's internal "last drawn" cache is stale: engage() - // physically clears the terminal screen but the cache still holds the - // pre-suspend content. Sync() invalidates the cache so the next Show() - // call sends a full redraw instead of writing nothing. - + // engage() clears the physical screen but leaves tcell's "last drawn" + // cache stale. Sync() invalidates it so the next Show() does a full redraw. g.screen.Sync() return nill }