mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	pty/shl.rb: update [ci skip]
* sample/pty/shl.rb: use io/console instead of stty. [ruby-dev:49974] [Bug #13191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									0d98fd889f
								
							
						
					
					
						commit
						69b6471104
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
#     q        quit
 | 
			
		||||
 | 
			
		||||
require 'pty'
 | 
			
		||||
require 'io/console'
 | 
			
		||||
 | 
			
		||||
$shells = []
 | 
			
		||||
$n_shells = 0
 | 
			
		||||
| 
						 | 
				
			
			@ -19,7 +20,7 @@ $r_pty = nil
 | 
			
		|||
$w_pty = nil
 | 
			
		||||
 | 
			
		||||
def writer
 | 
			
		||||
  system "stty -echo raw"
 | 
			
		||||
  STDIN.raw!
 | 
			
		||||
  begin
 | 
			
		||||
    while true
 | 
			
		||||
      c = STDIN.getc
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +35,7 @@ def writer
 | 
			
		|||
    $reader.raise('Exit')
 | 
			
		||||
    return 'Exit'
 | 
			
		||||
  ensure
 | 
			
		||||
    system "stty echo -raw"
 | 
			
		||||
    STDIN.cooked!
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue