Changeset 5541
- Timestamp:
- 06/27/08 14:57:28 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework3/trunk/lib/rex/ui/text/input/readline.rb
r5539 r5541 16 16 class Input::Readline < Rex::Ui::Text::Input 17 17 include ::Readline 18 18 19 19 # 20 20 # Initializes the readline-aware Input instance for text. … … 75 75 # 76 76 def pgets 77 78 if( true)77 78 if(Rex::Compat.is_windows()) 79 79 output.prompting 80 80 line = ::Readline.readline(prompt, true) … … 82 82 return line 83 83 end 84 84 85 # Wrap readline in a child process and secure with a mutex 86 # This prevents threading hangs in the calling process. 87 require "thread" 88 @@child_mutex ||= Mutex.new 89 @@child_mutex.synchronize do 85 90 86 91 output.prompting … … 112 117 eof = true 113 118 return line 119 end 120 121 # Release the readline mutex 114 122 end 115 123 end
