From 4293aac54ea0cd3c8a28c7071a328e8e3e732d32 Mon Sep 17 00:00:00 2001 From: sjanusz-r7 Date: Tue, 10 Dec 2024 10:56:26 +0000 Subject: [PATCH] Use existing input object when calling init_tab_complete --- lib/msf/ui/console/driver.rb | 2 +- lib/rex/ui/text/shell.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index bc42cb1a4cb9..710373cca1ae 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -107,7 +107,7 @@ def initialize(prompt = DefaultPrompt, prompt_char = DefaultPromptChar, opts = { # Initialize the user interface to use a different input and output # handle if one is supplied input = opts['LocalInput'] - input ||= Rex::Ui::Text::Input::Stdio.new + input ||= Rex::Ui::Text::Input::Readline.new if !opts['Readline'] input.disable_readline diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index 56a323c5bfac..ca080ab61478 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -66,8 +66,7 @@ def initialize(prompt, prompt_char = '>', histfile = nil, framework = nil, name def init_tab_complete if (self.input and self.input.supports_readline) # Unless cont_flag because there's no tab complete for continuation lines - self.input = Input::Readline.new(lambda { |str| tab_complete(str) unless cont_flag }) - self.input.output = self.output + self.input.reset_tab_completion(lambda { |str| tab_complete(str) unless cont_flag }) end end