From a482f20ba37d97cfaa6a48be57abfd2faf768448 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 5 Oct 2020 19:55:39 +1100 Subject: [PATCH] kill process if nothing happens two seconds after final event --- pkg/gui/recording.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/gui/recording.go b/pkg/gui/recording.go index 57bf27948..12b1fc3fd 100644 --- a/pkg/gui/recording.go +++ b/pkg/gui/recording.go @@ -6,6 +6,8 @@ import ( "log" "os" "time" + + "github.com/jesseduffield/gocui" ) func recordingEvents() bool { @@ -47,6 +49,16 @@ func (gui *Gui) replayRecordedEvents() { } } } + + time.Sleep(time.Second * 1) + + gui.g.Update(func(*gocui.Gui) error { + return gocui.ErrQuit + }) + + time.Sleep(time.Second * 1) + + log.Fatal("lazygit should have already exited") } func (gui *Gui) loadRecordedEvents() ([]RecordedEvent, error) {