mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-27 20:31:17 -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:
@@ -45,6 +45,7 @@
|
||||
#include "input_common.h"
|
||||
#include "maybe.h"
|
||||
#include "output.h"
|
||||
#include "parser.h"
|
||||
#include "proc.h"
|
||||
#include "reader.h"
|
||||
#include "screen.h"
|
||||
@@ -211,7 +212,9 @@ static void universal_callback(env_stack_t *stack, const callback_data_t &cb) {
|
||||
|
||||
env_dispatch_var_change(cb.key, *stack);
|
||||
stack->mark_changed_exported();
|
||||
event_fire(event_t::variable(cb.key, {L"VARIABLE", op, cb.key}));
|
||||
|
||||
// TODO: eliminate this principal_parser. Need to rationalize how multiple threads work here.
|
||||
event_fire(parser_t::principal_parser(), event_t::variable(cb.key, {L"VARIABLE", op, cb.key}));
|
||||
}
|
||||
|
||||
void env_universal_callbacks(env_stack_t *stack, const callback_data_list_t &callbacks) {
|
||||
|
||||
Reference in New Issue
Block a user