From 61c138334d9fd93ca5760fdf685080f285251193 Mon Sep 17 00:00:00 2001 From: Oldes Date: Wed, 28 Aug 2019 18:37:03 +0200 Subject: [PATCH] FIX: errors should not HALT to the console but QUIT to the system Fixes issue #2215. It is just a small modification, where in case of script error, the script QUITs instead of HALTing in REPL console. When `system/options/quiet = FALSE`, than there is 3s delay, before automatic quit. During this time user may use CTRL-C to HALT and enter the REPL for in place debugging. When used `--halt` option, it enters the REPL as it was before without any wait. (Don't know if it is the best way, but I'm not sure if a new option is really needed for forcing REPL in case of errors). --- src/os/host-main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/os/host-main.c b/src/os/host-main.c index 2138e6769b..0c33e2c926 100644 --- a/src/os/host-main.c +++ b/src/os/host-main.c @@ -311,6 +311,9 @@ int main(int argc, char **argv) { || (Main_Args.options & RO_HALT) // --halt option ) ){ + if (n < 0 && !(Main_Args.options & RO_HALT)) { + RL_Do_String(b_cast("unless system/options/quiet [print {^[[mClosing in 3s!} wait 3] quit/return -1"), 0, 0); + } Host_Repl(); }