Land #5499, polish dem spinners

bug/bundler_fix
William Vu 2015-06-06 15:21:09 -05:00
commit 89e7dc6cf2
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
2 changed files with 14 additions and 4 deletions

View File

@ -19,11 +19,21 @@ class Metasploit::Framework::Command::Console < Metasploit::Framework::Command::
return if Rex::Compat.is_cygwin
return if $msf_spinner_thread
$msf_spinner_thread = Thread.new do
$stderr.print "[*] Starting the Metasploit Framework console..."
base_line = "[*] Starting the Metasploit Framework console..."
cycle = 0
loop do
%q{/-\|}.each_char do |c|
$stderr.print c
$stderr.print "\b"
status = "#{base_line}#{c}\r"
cycle += 1
off = cycle % base_line.length
case status[off, 1]
when /[a-z]/
status[off, 1] = status[off, 1].upcase
when /[A-Z]/
status[off, 1] = status[off, 1].downcase
end
$stderr.print status
::IO.select(nil, nil, nil, 0.10)
end
end
end

View File

@ -547,7 +547,7 @@ class Driver < Msf::Ui::Driver
if $msf_spinner_thread
$msf_spinner_thread.kill
$stderr.print "\n"
$stderr.print "\r" + (" " * 60) + "\n"
end
run_single("banner") unless opts['DisableBanner']