Skip to content

Commit

Permalink
Stop byebug by C-d too
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Oct 14, 2015
1 parent ac99d5f commit e9594c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pry-byebug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
require 'pry-byebug/base'
require 'pry-byebug/pry_ext'
require 'pry-byebug/commands'
require 'pry-byebug/control_d_handler'
7 changes: 7 additions & 0 deletions lib/pry-byebug/control_d_handler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pry.config.control_d_handler = proc do |eval_string, _pry_|
if Byebug.catchpoints.empty? && Byebug.breakpoints.empty?
Byebug.stop
end

Pry::DEFAULT_CONTROL_D_HANDLER.call(eval_string, _pry_)
end

0 comments on commit e9594c1

Please sign in to comment.