Eliminate shell_is_interactive

We used to have a global notion of "is the shell interactive" but soon we
will want to have multiple independent execution threads, only some of
which may be interactive. Start tracking this data per-parser.
This commit is contained in:
ridiculousfish
2019-05-27 14:52:48 -07:00
parent 3f1d7bbdc5
commit 4a2c709fb1
20 changed files with 85 additions and 104 deletions

View File

@@ -276,13 +276,12 @@ static void event_fire_internal(parser_t &parser, const event_t &event) {
// Event handlers are not part of the main flow of code, so they are marked as
// non-interactive.
proc_push_interactive(0);
scoped_push<bool> interactive{&ld.is_interactive, false};
auto prev_statuses = parser.get_last_statuses();
block_t *b = parser.push_block(block_t::event_block(event));
parser.eval(buffer, io_chain_t(), TOP);
parser.pop_block(b);
proc_pop_interactive();
parser.set_last_statuses(std::move(prev_statuses));
}
}