Skip to content

Commit

Permalink
FIX: errors should not HALT to the console but QUIT to the system
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Oldes committed Aug 28, 2019
1 parent 89642e5 commit 61c1383
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/os/host-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

2 comments on commit 61c1383

@Oldes
Copy link
Owner Author

@Oldes Oldes commented on 61c1383 Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Oldes
Copy link
Owner Author

@Oldes Oldes commented on 61c1383 Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note, that when running script with --do and or script, than system/options/quiet is true by default, so there is not default delay before quit!

if any [do-arg script] [quiet: true]

Please sign in to comment.