diff --git a/lib/rex/ui/interactive.rb b/lib/rex/ui/interactive.rb index 445da8dcf3..c8d69e48d6 100644 --- a/lib/rex/ui/interactive.rb +++ b/lib/rex/ui/interactive.rb @@ -253,11 +253,11 @@ protected # Installs a signal handler to monitor suspend signal notifications. # def handle_suspend - if (orig_suspend == nil) + if orig_suspend.nil? begin - self.orig_suspend = Signal.trap("TSTP") { - _suspend - } + self.orig_suspend = Signal.trap("TSTP") do + Thread.new { _suspend }.join + end rescue end end @@ -269,7 +269,7 @@ protected # def restore_suspend begin - if (orig_suspend) + if orig_suspend Signal.trap("TSTP", orig_suspend) else Signal.trap("TSTP", "DEFAULT")