summaryrefslogtreecommitdiffstats
path: root/pkg/gui/recording.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-05 19:55:39 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commita482f20ba37d97cfaa6a48be57abfd2faf768448 (patch)
treea39500f1fb1b8a15184db9871eaf5b14c74e78cf /pkg/gui/recording.go
parentc36349f460cc03621cb6b772732990a690ed45d6 (diff)
kill process if nothing happens two seconds after final event
Diffstat (limited to 'pkg/gui/recording.go')
-rw-r--r--pkg/gui/recording.go12
1 files changed, 12 insertions, 0 deletions
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) {