1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-03-20 11:23:41 +01:00
aerc/lib
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
..
auth auth: fallback to login if plain isn't supported 2026-03-15 17:39:12 +01:00
authres lib: rename auth to authres 2026-02-09 14:46:27 +01:00
autoconfig chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
calendar calendar: make invitation matching case-insensitive 2024-02-11 21:24:18 +01:00
crypto config: allow specifying the temporary directory 2025-10-30 21:17:44 +01:00
format ui: properly trim spaces from addresses 2025-05-21 18:30:55 +02:00
hooks reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
ipc treewide: fix English spelling 2025-01-21 13:39:01 +01:00
iterator treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
jwz treewide: run go modernize 2025-12-20 18:06:30 +01:00
log treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
marker chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
notmuch notmuch: simplify source URL and use automatic discovery 2026-03-07 21:39:01 +01:00
pama treewide: run go modernize 2025-12-20 18:06:30 +01:00
parse treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
pinentry reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
rfc822 rfc822: be more lenient with body structure 2026-02-13 09:11:10 +01:00
send auth: fallback to login if plain isn't supported 2026-03-15 17:39:12 +01:00
sort treewide: replace uint32 uids with opaque strings 2024-08-28 12:06:01 +02:00
state reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
templates treewide: run go modernize 2025-12-20 18:06:30 +01:00
ui ui: handle SIGTERM and SIGINT for graceful shutdown 2026-03-15 17:39:12 +01:00
watchers watchers: remove fsevents.FileEvents flag on Darwin 2026-02-10 11:10:28 +01:00
xdg history: read the history file from XDG_STATE_HOME 2024-10-24 22:13:51 +02:00
attachment.go attach: fix content-transfer-encoding for rfc822 attachments 2024-10-24 22:13:51 +02:00
dirstore.go dirstore: list the folders in arrival order 2023-05-28 18:21:26 +02:00
dirstore_test.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
emlview.go rfc822: parse multipart messages on a best efforts basis 2024-11-21 22:27:19 +01:00
history.go commands: add :repeat 2026-03-07 19:48:38 +01:00
inlineimages.go viewer: add html-inline-images option 2025-12-04 13:52:37 +01:00
keepalive_dummy.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
keepalive_linux.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
messageview.go messageview: never cancel fetchbodypart 2026-02-13 09:08:31 +01:00
msgstore.go msgstore: add index field for incremental updates 2026-02-09 14:46:27 +01:00
notmuch_version.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
notmuch_version_dummy.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
open.go reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
structure_helpers.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
structure_helpers_test.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
threadbuilder.go lib: vendor-in the jwz library 2025-08-28 09:28:16 +02:00