]> Repositorios git - scryer-prolog.git/commit
Raise interrupt exception on Ctrl-C at the read prompt
authorJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 11:04:12 +0000 (13:04 +0200)
committerJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 11:04:12 +0000 (13:04 +0200)
commit2c057b7c413c3b8ca55c65bca78b22abbecb3c18
tree3ad5718ac2ffdb1ef42fc45d2e13c60fc4c7d60f
parent844f8e23474d698f41d8ba48a5bc788cd54b4735
Raise interrupt exception on Ctrl-C at the read prompt

While rustyline holds the terminal in raw mode, Ctrl-C is delivered as
ReadlineError::Interrupted rather than as a SIGINT, so the ctrlc handler
never sets the INTERRUPT flag. call_readline also lumped Interrupted
into the generic IO-error arm, which read_term then mis-classified as
end_of_file -- so Ctrl-C at a read/1 prompt unified end_of_file instead
of interrupting.

Handle ReadlineError::Interrupted explicitly: set INTERRUPT and return an
Interrupted IO error. read_term now checks the flag in its error arm and
raises the interrupt exception instead of falling through to the EOF or
syntax-error handling.
src/machine/machine_state.rs
src/read.rs