This is a first-pass at allowing for refusing to start the REPL when there is no TTY available.
However, my preferred approach would be to nuke this concept of interactive vs non-interactive and replace with the following options for 'repl-mode':
- tty
- process
- disabled
disabled is akin to what happens when you run perl or python, it just sits there waiting for STDIN to complete with an <EOF>, then runs the code. It's identical to what non-interactive means at the moment.
tty is the default and is really only presented to the user for completeness' sake.
process is the same as interactive except that it explicitly refers to the expectation that STDIN and STDOUT will not be TTY. This would resolve the ambiguity that occurs with this patch where is-interactive is only set when interactive is explictly passed to repl-mode regardless of the fact that a regular, default REPL session is also clearly classifiable as interactive.
This is a first-pass at allowing for refusing to start the REPL when there is no TTY available.
However, my preferred approach would be to nuke this concept of interactive vs non-interactive and replace with the following options for 'repl-mode':
disabled
is akin to what happens when you runperl
orpython
, it just sits there waiting for STDIN to complete with an<EOF>
, then runs the code. It's identical to whatnon-interactive
means at the moment.tty
is the default and is really only presented to the user for completeness' sake.process
is the same asinteractive
except that it explicitly refers to the expectation that STDIN and STDOUT will not be TTY. This would resolve the ambiguity that occurs with this patch whereis-interactive
is only set wheninteractive
is explictly passed torepl-mode
regardless of the fact that a regular, default REPL session is also clearly classifiable as interactive.