From af42f517b838233ed5d716b043660c2518ac8e4e Mon Sep 17 00:00:00 2001 From: James Lee Date: Tue, 17 Oct 2017 16:22:47 -0500 Subject: [PATCH] Default PromptTimeFormat to %T --- lib/rex/ui/text/shell.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index 4c9cc27d2a..9b115fa83f 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -42,7 +42,7 @@ module Shell # Set the stop flag to false self.stop_flag = false self.disable_output = false - self.stop_count = 0 + self.stop_count = 0 # Initialize the prompt self.init_prompt = prompt @@ -132,9 +132,10 @@ module Shell if framework if input.prompt.include?("%T") t = Time.now - if framework.datastore['PromptTimeFormat'] - t = t.strftime(framework.datastore['PromptTimeFormat']) - end + # This %T is the strftime shorthand for %H:%M:%S + format = framework.datastore['PromptTimeFormat'] || "%T" + t = t.strftime(format) + # This %T is the marker in the prompt where we need to place the time input.prompt.gsub!(/%T/, t.to_s) end