diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-05-14 16:33:25 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-08-02 11:35:36 +0200 |
commit | 8ce60662f2452bcb85b47b76f5a9aef0382a1f45 (patch) | |
tree | 67d28548df6ccdb53c5d2b9d3945f110db90f7db /pkg | |
parent | c5acbb6c7c9678c5ff55e490a18b3ce4f3d7df37 (diff) |
Refresh when the terminal window gets the focus
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/gui.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index f1e20da41..ad3dc3e34 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -288,6 +288,15 @@ func (gui *Gui) onNewRepo(startArgs appTypes.StartArgs, contextKey types.Context return err } + gui.g.SetFocusHandler(func(Focused bool) error { + if Focused { + gui.c.Log.Info("Receiving focus - refreshing") + return gui.helpers.Refresh.Refresh(types.RefreshOptions{Mode: types.ASYNC}) + } + + return nil + }) + // if a context key has been given, push that instead, and set its index to 0 if contextKey != context.NO_CONTEXT { contextToPush = gui.c.ContextForKey(contextKey) |