]> Repositorios git - scryer-prolog.git/commit
Raise interrupt exception on Ctrl-C at the read prompt
authorJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 22:02:07 +0000 (00:02 +0200)
committerJavier Sagredo <[email protected]>
Wed, 17 Jun 2026 22:02:07 +0000 (00:02 +0200)
commitbd0d62c33be3b3ff41741950c61a6bb66d6b05e9
tree43c7abd52e970f103096a44ad5449cbb5ec09228
parentdaaab1cb3738c13274b5ad82a1047639bc13bc36
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 pushed 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