deivid-rodriguez / byebug

Debugging in Ruby 2
BSD 2-Clause "Simplified" License
3.34k stars 328 forks source link

Provide a way to exit the program without exiting the Rails Console #796

Open jackrg opened 3 years ago

jackrg commented 3 years ago

Problem description

When running in the Rails Console, the only way to abort the program and return to the Rails Console is with Ctrl-C while the program is running. In older versions of byebug (e.g. with Ruby 2.0/Rails 3.2), Ctrl-C at the byebug prompt would do this, but with newer versions (Ruby 2.4/Rails 5.1) this no longer works.

Expected behavior

At the byebug prompt (e.g. "(byebug)"), I would expect Ctrl-C to drop me back to the Rails Console.

Actual behavior

At the byebug prompt (e.g. "(byebug)"), when I hit Ctrl-C I just got another "(byebug)" prompt.

Load the Rails console with a breakpoint in your program, then start it up. At the breakpoint, hit Ctrl-C.