[前][次][番号順一覧][スレッド一覧]

ruby-changes:45459

From: nobu <ko1@a...>
Date: Sat, 4 Feb 2017 19:48:17 +0900 (JST)
Subject: [ruby-changes:45459] nobu:r57532 (trunk): pty/shl.rb: update [ci skip]

nobu	2017-02-04 19:48:14 +0900 (Sat, 04 Feb 2017)

  New Revision: 57532

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57532

  Log:
    pty/shl.rb: update [ci skip]
    
    * sample/pty/shl.rb: use io/console instead of stty.
      [ruby-dev:49974] [Bug #13191]

  Modified files:
    trunk/sample/pty/shl.rb
Index: sample/pty/shl.rb
===================================================================
--- sample/pty/shl.rb	(revision 57531)
+++ sample/pty/shl.rb	(revision 57532)
@@ -11,6 +11,7 @@ https://github.com/ruby/ruby/blob/trunk/sample/pty/shl.rb#L11
 #     q        quit
 
 require 'pty'
+require 'io/console'
 
 $shells = []
 $n_shells = 0
@@ -19,7 +20,7 @@ $r_pty = nil https://github.com/ruby/ruby/blob/trunk/sample/pty/shl.rb#L20
 $w_pty = nil
 
 def writer
-  system "stty -echo raw"
+  STDIN.raw!
   begin
     while true
       c = STDIN.getc
@@ -34,7 +35,7 @@ def writer https://github.com/ruby/ruby/blob/trunk/sample/pty/shl.rb#L35
     $reader.raise('Exit')
     return 'Exit'
   ensure
-    system "stty echo -raw"
+    STDIN.cooked!
   end
 end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]