Disable mouse when exiting due to a panic

This commit is contained in:
Christian Rocha
2021-05-04 21:47:24 -04:00
parent 3dff6d4b58
commit 4fbe50adb6

2
tea.go
View File

@@ -325,6 +325,8 @@ func (p *Program) Start() error {
defer func() {
if r := recover(); r != nil {
p.ExitAltScreen()
p.DisableMouseCellMotion()
p.DisableMouseAllMotion()
fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r)
debug.PrintStack()
return