Skip to content

Commit ce40c11

Browse files
committed
Land rapid7#4014, msfconsole spinnerz
2 parents 10f3969 + a431bff commit ce40c11

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/metasploit/framework/command/console.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,26 @@
77

88
# Based on pattern used for lib/rails/commands in the railties gem.
99
class Metasploit::Framework::Command::Console < Metasploit::Framework::Command::Base
10+
11+
def spinner
12+
return if $msf_spinner_thread
13+
$msf_spinner_thread = Thread.new do
14+
$stderr.print "[*] Starting the Metasploit Framework console..."
15+
loop do
16+
%q{/-\|}.each_char do |c|
17+
$stderr.print c
18+
$stderr.print "\b"
19+
end
20+
end
21+
end
22+
end
23+
1024
def start
1125
case parsed_options.options.subcommand
1226
when :version
1327
$stderr.puts "Framework Version: #{Metasploit::Framework::VERSION}"
1428
else
29+
spinner unless parsed_options.options.console.quiet
1530
driver.run
1631
end
1732
end

lib/msf/ui/console/driver.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,11 @@ def on_startup(opts = {})
535535

536536
framework.events.on_ui_start(Msf::Framework::Revision)
537537

538+
if $msf_spinner_thread
539+
$msf_spinner_thread.kill
540+
$stderr.print "\n"
541+
end
542+
538543
run_single("banner") unless opts['DisableBanner']
539544

540545
opts["Plugins"].each do |plug|

0 commit comments

Comments
 (0)