unix/main: Enter REPL when inspect active, even with stdin redirected.

This is how CPython behaves.
This commit is contained in:
Yu-Ming Chang 2020-05-14 16:49:13 +08:00 committed by Damien George
parent cd9a8c1742
commit dd8db974d7
1 changed files with 1 additions and 1 deletions

View File

@ -657,7 +657,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
inspect = true; inspect = true;
} }
if (ret == NOTHING_EXECUTED || inspect) { if (ret == NOTHING_EXECUTED || inspect) {
if (isatty(0)) { if (isatty(0) || inspect) {
prompt_read_history(); prompt_read_history();
ret = do_repl(); ret = do_repl();
prompt_write_history(); prompt_write_history();