From 69b647110437dff0b6bf9da2b08ec9a2ae6cf343 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 4 Feb 2017 10:48:14 +0000 Subject: 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 --- sample/pty/shl.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sample') 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 -- cgit v1.2.1