Hi,

In message "Re: [ruby-core:19687] Re: [Bug #694] eof? call on a pty IO object causes application to exit"
    on Tue, 4 Nov 2008 03:54:38 +0900, Dave Thomas <dave / pragprog.com> writes:

|> require 'pty'
|>
|> PTY.spawn("/bin/echo hello") do |reader, writer, pid|
|>  reader.eof?
|>  puts reader.gets
|> end
|>
|> dave[~ 1:39:43] ruby -v t.rb
|> ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
|> hello
|>
|> dave[~ 1:39:45] /usr/local/rubybook/bin/ruby -v t.rb
|> ruby 1.9.0 (2008-10-29 revision 15427) [i386-darwin9.5.0]
|> t.rb:4:in `eof?': pty - exited: 731 (PTY::ChildExited)
|> 	from t.rb:4:in `block in <main>'
|> 	from t.rb:3:in `spawn'
|> 	from t.rb:3:in `<main>'
|
|I wonder if the problem is that pty.c doesn't release the global lock,  
|and therefore any output from the subthread that's running the shell  
|is never seen?

Actually, 1.9 releases the global lock, so there was a chance for
subthread to send an exception to the main thread.  I am not sure how
(and what) we can do.

							matz.