read: Actually only fire fish_read, not fish_prompt event

Fixes #8797.
This commit is contained in:
Fabian Homborg
2022-03-16 20:14:59 +01:00
parent 4e2ce0af4e
commit 534646f9d3
4 changed files with 20 additions and 2 deletions

View File

@@ -2799,6 +2799,7 @@ static int read_i(parser_t &parser) {
conf.syntax_check_ok = true;
conf.autosuggest_ok = check_autosuggestion_enabled(parser.vars());
conf.expand_abbrev_ok = true;
conf.event = L"fish_prompt";
if (parser.is_breakpoint() && function_exists(DEBUG_PROMPT_FUNCTION_NAME, parser)) {
conf.left_prompt_cmd = DEBUG_PROMPT_FUNCTION_NAME;
@@ -4009,7 +4010,9 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
}
first_prompt = false;
event_fire_generic(parser(), L"fish_prompt");
if (!conf.event.empty()) {
event_fire_generic(parser(), conf.event.c_str());
}
exec_prompt();
/// A helper that kicks off syntax highlighting, autosuggestion computing, and repaints.