forked from Mirrors/bubbletea
Disable mouse when exiting due to a panic
This commit is contained in:
parent
3dff6d4b58
commit
4fbe50adb6
2
tea.go
2
tea.go
|
@ -325,6 +325,8 @@ func (p *Program) Start() error {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
p.ExitAltScreen()
|
p.ExitAltScreen()
|
||||||
|
p.DisableMouseCellMotion()
|
||||||
|
p.DisableMouseAllMotion()
|
||||||
fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r)
|
fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r)
|
||||||
debug.PrintStack()
|
debug.PrintStack()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue