Module: Rex::Ui::Text::Shell::InputShell

Defined in:
lib/rex/ui/text/shell.rb

Overview

This module is meant to be mixed into an input medium class instance as a means of extending it to display a prompt before each call to gets.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#outputObject

Returns the value of attribute output


23
24
25
# File 'lib/rex/ui/text/shell.rb', line 23

def output
  @output
end

#promptObject

Returns the value of attribute prompt


23
24
25
# File 'lib/rex/ui/text/shell.rb', line 23

def prompt
  @prompt
end

Instance Method Details

#pgetsObject


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rex/ui/text/shell.rb', line 25

def pgets()

  output.print(prompt)
  output.flush

  output.prompting
  buf = gets
  output.prompting(false)

  buf
end