1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

get tcell to cleanup the terminal if we panic

This commit is contained in:
Jesse Duffield
2021-02-09 22:19:49 +11:00
parent 1fb2317bac
commit ecc5fe24a9
3 changed files with 19 additions and 18 deletions

View File

@ -14,6 +14,7 @@ import (
"time"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
)
// SplitLines takes a multiline string and splits it on newlines
@ -366,9 +367,8 @@ func ResolveTemplate(templateStr string, object interface{}) (string, error) {
func Safe(f func()) {
panicking := true
defer func() {
if panicking {
// TODO: close tcell
// termbox.Close()
if panicking && gocui.Screen != nil {
gocui.Screen.Fini()
}
}()