mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-17 16:11:15 -03:00
Fix interactive --on-signal INT handlers
f8ba0ac5bf introduced a bug where INT handlers would themselves be
cancelled, due to the signal. Defer processing handlers until the
parser is ready to execute more fish script.
Fixes the interactive case of #6649.
This commit is contained in:
@@ -288,6 +288,8 @@ void event_fire_delayed(parser_t &parser) {
|
||||
auto &ld = parser.libdata();
|
||||
// Do not invoke new event handlers from within event handlers.
|
||||
if (ld.is_event) return;
|
||||
// Do not invoke new event handlers if we are unwinding (#6649).
|
||||
if (parser.get_cancel_signal()) return;
|
||||
|
||||
std::vector<shared_ptr<event_t>> to_send;
|
||||
to_send.swap(ld.blocked_events);
|
||||
|
||||
@@ -376,6 +376,9 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
|
||||
void get_backtrace(const wcstring &src, const parse_error_list_t &errors,
|
||||
wcstring &output) const;
|
||||
|
||||
/// \return the signal triggering cancellation, or 0 if none.
|
||||
int get_cancel_signal() const { return cancellation_signal; }
|
||||
|
||||
/// Output profiling data to the given filename.
|
||||
void emit_profiling(const char *path) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user