mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-11 22:21:14 -03:00
Make events per-parser
This makes the following changes: 1. Events in background threads are executed in those threads, instead of being silently dropped 2. Blocked events are now per-parser instead of global 3. Events are posted in builtin_set instead of within the environment stack The last one means that we no longer support event handlers for implicit sets like (example) argv. Instead only the `set` builtin (and also `cd`) post variable-change events. Events from universal variable changes are still not fully rationalized.
This commit is contained in:
@@ -522,11 +522,12 @@ int main(int argc, char **argv) {
|
||||
|
||||
// TODO: The generic process-exit event is useless and unused.
|
||||
// Remove this in future.
|
||||
event_fire(proc_create_event(L"PROCESS_EXIT", event_type_t::exit, getpid(), exit_status));
|
||||
event_fire(parser,
|
||||
proc_create_event(L"PROCESS_EXIT", event_type_t::exit, getpid(), exit_status));
|
||||
|
||||
// Trigger any exit handlers.
|
||||
wcstring_list_t event_args = {to_string(exit_status)};
|
||||
event_fire_generic(L"fish_exit", &event_args);
|
||||
event_fire_generic(parser, L"fish_exit", &event_args);
|
||||
|
||||
restore_term_mode();
|
||||
restore_term_foreground_process_group();
|
||||
|
||||
Reference in New Issue
Block a user