When vaxis receives SIGTERM, it posts a QuitEvent via a non-blocking
send which can be silently dropped if the event queue is full. Even when
delivered, aerc's HandleEvent never matches QuitEvent so the signal is
ignored. The main loop stays stuck in its select forever.
This was lost in the tcell to vaxis migration. With tcell,
ChannelEvents() was tied to the Quit channel and signals caused aerc to
exit properly.
Register SIGTERM and SIGINT directly and call Exit() to close the Quit
channel, allowing the main loop to break out and perform a clean
shutdown (closing backends, running the aerc-shutdown hook, restoring
the terminal).
Fixes: 0fd5f41157 ("ui: initialize vaxis directly, drop tcell.Screen initialization")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tristan Partin <tristan@partin.io>