Raku / nqp

NQP
Other
345 stars 131 forks source link

Add is-interactive to HLL::Compiler #827

Closed ab5tract closed 6 days ago

ab5tract commented 2 weeks ago

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.

ab5tract commented 2 weeks ago

I've decided to just do the entire set of proposed changes to repl-mode instead of simply proposing said changes :)