mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-26 19:05:52 +03:00
[GH-ISSUE #339] panic: unknown tcell event type: <nil> #156
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kmulvey on GitHub (Oct 14, 2022).
Original GitHub issue: https://github.com/mum4k/termdash/issues/339
I get this error every time I try to quit (by pressing 'q'). It also leaves the terminal window in an unusable state. Where do i start debugging this? The stack trace doesnt even list any of my code.
Full code is here: https://github.com/kmulvey/text2speech/blob/main/dashboard.go
@mum4k commented on GitHub (Oct 18, 2022):
I think the problem here is an invalid order of termination. The implemented quitter calls
term.Close()thus closing the terminal object that was given to Termdash for use. This breaks the lifetime guarantee - objects given to called functions must outlive those function calls.What happens is that the
termobject shuts down and becomes invalid. But there is some concurrency that still attempts to use it via termdash, probably in one of those goroutines.The solution is to make sure that termdash and all goroutines are correctly terminated before the
termobject gets closed. Termination should be done in the exact opposite order of construction.You can look at the demos for an example of a correct termination sequence, e.g. the
termdashdemo:https://github.com/mum4k/termdash/blob/master/termdashdemo/termdashdemo.go