diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index a10011cf49..0393c12ba1 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -124,7 +124,7 @@ class Core print_line("Enable or disable color output.") return end - driver.update_prompt('') + driver.update_prompt end def cmd_resource(*args) diff --git a/lib/rex/ui/text/dispatcher_shell.rb b/lib/rex/ui/text/dispatcher_shell.rb index 23531bd2e5..b31577f307 100644 --- a/lib/rex/ui/text/dispatcher_shell.rb +++ b/lib/rex/ui/text/dispatcher_shell.rb @@ -183,7 +183,8 @@ module DispatcherShell found = false error = false - output.reset_color + # If output is disabled output will be nil + output.reset_color if (output) if (method) entries = dispatcher_stack.length diff --git a/lib/rex/ui/text/output.rb b/lib/rex/ui/text/output.rb index 4ec4552c0d..fec8bb00c2 100644 --- a/lib/rex/ui/text/output.rb +++ b/lib/rex/ui/text/output.rb @@ -39,7 +39,8 @@ class Output < Rex::Ui::Output @config[:color] = :auto end - def update_prompt(prompt) + def update_prompt(prompt = nil) + return if prompt.nil? substitute_colors(prompt) end