mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-16 10:11: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:
@@ -2242,7 +2242,7 @@ static int read_i(parser_t &parser) {
|
||||
data->prev_end_loop = 0;
|
||||
|
||||
while (!shell_is_exiting()) {
|
||||
event_fire_generic(L"fish_prompt");
|
||||
event_fire_generic(parser, L"fish_prompt");
|
||||
run_count++;
|
||||
|
||||
if (parser.libdata().is_breakpoint && function_exists(DEBUG_PROMPT_FUNCTION_NAME, parser)) {
|
||||
@@ -2271,9 +2271,9 @@ static int read_i(parser_t &parser) {
|
||||
data->command_line.text.clear();
|
||||
data->command_line_changed(&data->command_line);
|
||||
wcstring_list_t argv(1, command);
|
||||
event_fire_generic(L"fish_preexec", &argv);
|
||||
event_fire_generic(parser, L"fish_preexec", &argv);
|
||||
reader_run_command(parser, command);
|
||||
event_fire_generic(L"fish_postexec", &argv);
|
||||
event_fire_generic(parser, L"fish_postexec", &argv);
|
||||
// Allow any pending history items to be returned in the history array.
|
||||
if (data->history) {
|
||||
data->history->resolve_pending();
|
||||
|
||||
Reference in New Issue
Block a user