summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-04 10:48:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-04 10:48:14 +0000
commit69b647110437dff0b6bf9da2b08ec9a2ae6cf343 (patch)
treef1844fd781afdc0ddec7993122af13b938df98b0 /sample
parent0d98fd889f7c0b7a503071a4e905230a32dbe5a4 (diff)
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
Diffstat (limited to 'sample')
-rw-r--r--sample/pty/shl.rb5
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