charmbracelet/bubbletea

Application hang when calling panic

timmattison opened this issue · 2 comments

Describe the bug
I have gotten my application to hang in a way that I can't get out of it without killing it from another terminal when calling panic while the application is initializing. If the application panics at a later time it exits properly.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS - macOS Sonoma 14.2.1
  • Shell - zsh
  • Terminal Emulator - iterm2
  • Terminal Multiplexer - N/A

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/timmattison/bubbletea-hang
  2. Run go run main2.go model.go
  3. Kill the process from another terminal

Source Code
Source code is in linked repo

Expected behavior
I would expect that it panics and exits but instead gets stuck when trying to write to the done channel.

r.done <- struct{}{}

I think #905 should fix this but I haven't had enough time to test it. Can anyone take a look and see what you think?

Closing as dupe of #924.