Handle exit in keybindings immediately

This simply checks if the parser requested exit after running any
binding scripts (in read_normal_chars).

I think this means we no longer need the `exit` bind function.

Fixes #7967.
This commit is contained in:
Fabian Homborg
2021-05-02 20:20:48 +02:00
parent 28b17879c7
commit 202e5e53d5
2 changed files with 21 additions and 0 deletions

View File

@@ -3932,6 +3932,11 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
}
}
// If we ran `exit` anywhere, exit.
exit_loop_requested |= parser().libdata().exit_current_script;
parser().libdata().exit_current_script = false;
if (exit_loop_requested) continue;
if (!event_needing_handling || event_needing_handling->is_check_exit()) {
continue;
} else if (event_needing_handling->is_eof()) {