Skip to content

Commit

Permalink
Refresh when the terminal window gets the focus
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaller committed Jul 31, 2023
1 parent 1602397 commit bfdc140
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bfdc140

Please sign in to comment.