From 4fbe50adb61316c6d19fefbf25807076feb5f7ff Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 4 May 2021 21:47:24 -0400 Subject: [PATCH] Disable mouse when exiting due to a panic --- tea.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tea.go b/tea.go index 59a595f..76d1d61 100644 --- a/tea.go +++ b/tea.go @@ -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