diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-02-09 22:19:49 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-06 19:34:32 +1000 |
commit | ecc5fe24a99532ddcb5e06d95a169ce257d5ff4a (patch) | |
tree | d3620f9d8e3238f892944240bc9c21c3045bb3fb /pkg/utils | |
parent | 1fb2317bac1a74eae4b5f831f3906abb984afeea (diff) |
get tcell to cleanup the terminal if we panic
Diffstat (limited to 'pkg/utils')
-rw-r--r-- | pkg/utils/utils.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 93925ad3a..d418e4b35 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -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() } }() |