Skip to content

Commit

Permalink
Merge pull request #19659 from sjanusz-r7/fix-irb-deadlock-error
Browse files Browse the repository at this point in the history
Fix IRB deadlock recursive locking on Ctrl+C
  • Loading branch information
adfoster-r7 authored Nov 19, 2024
2 parents 1d7e605 + bc45734 commit e6615d3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/rex/ui/text/irb_shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ def run
IRB.conf[:MAIN_CONTEXT] = irb.context

# Trap interrupt
old_sigint = trap("SIGINT") do
begin
begin
old_sigint = trap("SIGINT") do
irb.signal_handle
rescue RubyLex::TerminateLineInput
irb.eval_input
end
end

# Keep processing input until the cows come home...
catch(:IRB_EXIT) do
irb.eval_input
# Keep processing input until the cows come home...
catch(:IRB_EXIT) do
irb.eval_input
end
ensure
trap("SIGINT", old_sigint) if old_sigint
end

trap("SIGINT", old_sigint)
end

end
Expand Down

0 comments on commit e6615d3

Please sign in to comment.