Class: Command
- Inherits:
-
Object
- Object
- Command
- Defined in:
- lib/aniview/util/command.rb
Class Method Summary collapse
Class Method Details
.read(term, prompt = "", default = "") ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/aniview/util/command.rb', line 4 def self.read(term, prompt = "", default = "") term.bold.echo_on print "\033[" + String(term.rows) + ";1H" term.show_cursor Readline.pre_input_hook = -> do Readline.insert_text default Readline.redisplay Readline.pre_input_hook = nil end input = Readline.readline(prompt, false) term.hide_cursor.nobold.echo_off.clear return input end |