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
@ -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…
x
Reference in New Issue
Block a user