Skip to content

Commit 9713229

Browse files
jneenjneen
andauthored
fully exit the process on exit! from repl (#16171)
Similar to [Pry's `!!!`](https://github.com/pry/pry/blob/80816f596774d00afdc81a555724b0819bf26782/lib/pry/commands/exit_program.rb#L25), useful in the case where `debugger` has been put in a loop of some kind. When `exit!` is invoked from the repl, instead of breaking only the local debugger instance, the entire process is exited. I probably would have used `!!!`, but it would have required some changes in the `continue?` logic that I think are a little deeper-reaching than I was willing to go with this. Co-authored-by: jneen <[email protected]>
1 parent 51fe874 commit 9713229

File tree

1 file changed

+2
-0
lines changed
  • src/compiler/crystal/interpreter

1 file changed

+2
-0
lines changed

src/compiler/crystal/interpreter/repl.cr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class Crystal::Repl
2121
case expression
2222
when "exit"
2323
break
24+
when "exit!"
25+
Process.exit(0)
2426
when .presence
2527
result = parse_and_interpret(expression)
2628
result.warnings.report(STDOUT)

0 commit comments

Comments
 (0)