1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-03-20 11:23:41 +01:00
aerc/lib/ui
Robin Jarry de68dff37e ui: handle SIGTERM and SIGINT for graceful shutdown
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>
2026-03-15 17:39:12 +01:00
..
borders.go aerc: change event interfaces to vaxis events 2024-02-12 13:48:42 +01:00
box.go aerc: change event interfaces to vaxis events 2024-02-12 13:48:42 +01:00
context.go treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
fill.go fill: replace tcell.Style with vaxis.Style 2024-02-12 13:48:47 +01:00
grid.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
interfaces.go account: allow indicating new messages in the tab title 2025-04-07 10:51:14 +02:00
popover.go aerc: change event interfaces to vaxis events 2024-02-12 13:48:42 +01:00
stack.go mouse: use vaxis mouse events 2024-02-12 13:48:56 +01:00
string.go account: allow indicating new messages in the tab title 2025-04-07 10:51:14 +02:00
tab.go reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
table.go treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
text.go style: use vaxis style everywhere 2024-02-12 13:48:50 +01:00
textinput.go ui: implement C-left/C-right cursor controls for textinput 2025-06-30 11:05:30 +02:00
textinput_test.go ui: implement C-left/C-right cursor controls for textinput 2025-06-30 11:05:30 +02:00
ui.go ui: handle SIGTERM and SIGINT for graceful shutdown 2026-03-15 17:39:12 +01:00