Set exit status with delete-or-exit

(regression from d415350aaf)

This is important especially in e.g. the new Windows Terminal, because
for some reason that lets the tab stick around if the process exited
with a non-zero status.

Will add tests as soon as I figure out how.
This commit is contained in:
Fabian Homborg 2020-09-16 17:44:43 +02:00
parent f9505996e7
commit 1215717d20

View file

@ -2993,6 +2993,8 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
if (el->position() < el->size()) {
delete_char(false /* backward */);
} else if (c == rl::delete_or_exit && el->empty()) {
// This is by definition a successful exit, override the status
parser().set_last_statuses(statuses_t::just(STATUS_CMD_OK));
exit_loop_requested = true;
check_exit_loop_maybe_warning(this);
}