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

ruby-changes:28234

From: naruse <ko1@a...>
Date: Sun, 14 Apr 2013 06:39:33 +0900 (JST)
Subject: [ruby-changes:28234] naruse:r40286 (trunk): Send input after curses is ready or raise error

naruse	2013-04-14 06:39:23 +0900 (Sun, 14 Apr 2013)

  New Revision: 40286

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40286

  Log:
    Send input after curses is ready or raise error
    
    On Linux, ncurses's initscr aborts with showing
    "Error opening terminal: unknown.".
    This fix can catch the error message.

  Modified files:
    trunk/test/test_curses.rb

Index: test/test_curses.rb
===================================================================
--- test/test_curses.rb	(revision 40285)
+++ test/test_curses.rb	(revision 40286)
@@ -22,6 +22,7 @@ include Curses https://github.com/ruby/ruby/blob/trunk/test/test_curses.rb#L22
 init_screen
 begin
   result = Timeout.timeout(#{timeout}) do
+    print "!"
     #{src}
   end
 rescue Exception => e
@@ -32,6 +33,11 @@ ensure https://github.com/ruby/ruby/blob/trunk/test/test_curses.rb#L33
   $stdio.flush
 end
 src
+      wait = r.readpartial(1)
+      if wait != "!"
+        wait << r.readpartial(1000)
+        raise wait
+      end
       if input
         w.print(input)
         w.flush

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

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