diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-04 10:48:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-04 10:48:14 +0000 |
commit | 9b0f1a6912a84b14ce6d2131765cd5c0069d4df6 (patch) | |
tree | f1844fd781afdc0ddec7993122af13b938df98b0 | |
parent | bcfaccf4ac0cafb3ab93c5fbeeb82f5984881a3e (diff) | |
download | ruby-9b0f1a6912a84b14ce6d2131765cd5c0069d4df6.tar.gz |
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
-rw-r--r-- | sample/pty/shl.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sample/pty/shl.rb b/sample/pty/shl.rb index 1a878ac8aa..b5cc55fa83 100644 --- a/sample/pty/shl.rb +++ b/sample/pty/shl.rb @@ -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 |