| Module | Net::SSH::PromptMethods::Termios |
| In: |
lib/net/ssh/prompt.rb
lib/net/ssh/prompt.rb |
Displays the prompt to $stdout. If echo is false, the Termios library will be used to disable keystroke echoing for the duration of this method.
# File lib/net/ssh/prompt.rb, line 27
27: def prompt(prompt, echo=true)
28: $stdout.print(prompt)
29: $stdout.flush
30:
31: set_echo(false) unless echo
32: $stdin.gets.chomp
33: ensure
34: if !echo
35: set_echo(true)
36: $stdout.puts
37: end
38: end
Displays the prompt to $stdout. If echo is false, the Termios library will be used to disable keystroke echoing for the duration of this method.
# File lib/net/ssh/prompt.rb, line 27
27: def prompt(prompt, echo=true)
28: $stdout.print(prompt)
29: $stdout.flush
30:
31: set_echo(false) unless echo
32: $stdin.gets.chomp
33: ensure
34: if !echo
35: set_echo(true)
36: $stdout.puts
37: end
38: end