File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1503,14 +1503,24 @@ def cmd_spool(*args)
1503
1503
return
1504
1504
end
1505
1505
1506
+ color = driver . output . config [ :color ]
1507
+
1506
1508
if args [ 0 ] == "off"
1507
1509
driver . init_ui ( driver . input , Rex ::Ui ::Text ::Output ::Stdio . new )
1508
- print_status ( "Spooling is now disabled" )
1509
- return
1510
+ msg = "Spooling is now disabled"
1511
+ else
1512
+ driver . init_ui ( driver . input , Rex ::Ui ::Text ::Output ::Tee . new ( args [ 0 ] ) )
1513
+ msg = "Spooling to file #{ args [ 0 ] } ..."
1510
1514
end
1511
1515
1512
- driver . init_ui ( driver . input , Rex ::Ui ::Text ::Output ::Tee . new ( args [ 0 ] ) )
1513
- print_status ( "Spooling to file #{ args [ 0 ] } ..." )
1516
+ # Restore color and prompt
1517
+ driver . output . config [ :color ] = color
1518
+ prompt = framework . datastore [ 'Prompt' ] || Msf ::Ui ::Console ::Driver ::DefaultPrompt
1519
+ prompt_char = framework . datastore [ 'PromptChar' ] || Msf ::Ui ::Console ::Driver ::DefaultPromptChar
1520
+ driver . update_prompt ( "#{ prompt } #{ active_module . type } (%bld%red#{ active_module . shortname } %clr) " , prompt_char , true )
1521
+
1522
+ print_status ( msg )
1523
+ return
1514
1524
end
1515
1525
1516
1526
def cmd_sessions_help
You can’t perform that action at this time.
0 commit comments